home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2018 July / PCgo 07-2018 CD-ROM Germany.iso / nw.pak / Unnamed File 004754.txt < prev    next >
Encoding:
Text File  |  2015-07-29  |  126.6 KB  |  1,358 lines

  1. var allDescriptors=[{"dependencies":[],"name":"platform","scripts":[]},{"dependencies":["common","platform"],"name":"host","scripts":[]},{"dependencies":["platform"],"name":"common","scripts":[]},{"skip_compilation":["UITests.js"],"dependencies":["common","host","platform"],"name":"devtools_app","scripts":[]}];var applicationDescriptor;var _loadedScripts={};for(var k of[]);function loadResourcePromise(url)
  2. {return new Promise(load);function load(fulfill,reject)
  3. {var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.onreadystatechange=onreadystatechange;function onreadystatechange(e)
  4. {if(xhr.readyState!==4)
  5. return;if([0,200,304].indexOf(xhr.status)===-1)
  6. reject(new Error("While loading from url "+url+" server responded with a status of "+xhr.status));else
  7. fulfill(e.target.response);}
  8. xhr.send(null);}}
  9. function normalizePath(path)
  10. {if(path.indexOf("..")===-1&&path.indexOf('.')===-1)
  11. return path;var normalizedSegments=[];var segments=path.split("/");for(var i=0;i<segments.length;i++){var segment=segments[i];if(segment===".")
  12. continue;else if(segment==="..")
  13. normalizedSegments.pop();else if(segment)
  14. normalizedSegments.push(segment);}
  15. var normalizedPath=normalizedSegments.join("/");if(normalizedPath[normalizedPath.length-1]==="/")
  16. return normalizedPath;if(path[0]==="/"&&normalizedPath)
  17. normalizedPath="/"+normalizedPath;if((path[path.length-1]==="/")||(segments[segments.length-1]===".")||(segments[segments.length-1]===".."))
  18. normalizedPath=normalizedPath+"/";return normalizedPath;}
  19. function loadScriptsPromise(scriptNames)
  20. {var promises=[];var urls=[];var sources=new Array(scriptNames.length);var scriptToEval=0;for(var i=0;i<scriptNames.length;++i){var scriptName=scriptNames[i];var sourceURL=self._importScriptPathPrefix+scriptName;var schemaIndex=sourceURL.indexOf("://")+3;sourceURL=sourceURL.substring(0,schemaIndex)+normalizePath(sourceURL.substring(schemaIndex));if(_loadedScripts[sourceURL])
  21. continue;urls.push(sourceURL);promises.push(loadResourcePromise(sourceURL).then(scriptSourceLoaded.bind(null,i),scriptSourceLoaded.bind(null,i,undefined)));}
  22. return Promise.all(promises).then(undefined);function scriptSourceLoaded(scriptNumber,scriptSource)
  23. {sources[scriptNumber]=scriptSource||"";while(typeof sources[scriptToEval]!=="undefined"){evaluateScript(urls[scriptToEval],sources[scriptToEval]);++scriptToEval;}}
  24. function evaluateScript(sourceURL,scriptSource)
  25. {_loadedScripts[sourceURL]=true;if(!scriptSource){console.error("Empty response arrived for script '"+sourceURL+"'");return;}
  26. self.eval(scriptSource+"\n//# sourceURL="+sourceURL);}}
  27. (function(){var baseUrl=self.location?self.location.origin+self.location.pathname:"";self._importScriptPathPrefix=baseUrl.substring(0,baseUrl.lastIndexOf("/")+1);})();function Runtime(descriptors,coreModuleNames)
  28. {this._modules=[];this._modulesMap={};this._extensions=[];this._cachedTypeClasses={};this._descriptorsMap={};for(var i=0;i<descriptors.length;++i)
  29. this._registerModule(descriptors[i]);if(coreModuleNames)
  30. this._loadAutoStartModules(coreModuleNames);}
  31. Runtime._queryParamsObject={__proto__:null};Runtime.cachedResources={__proto__:null};Runtime.isReleaseMode=function()
  32. {return!!allDescriptors.length;}
  33. Runtime.startApplication=function(appName)
  34. {console.timeStamp("Runtime.startApplication");var allDescriptorsByName={};for(var i=0;Runtime.isReleaseMode()&&i<allDescriptors.length;++i){var d=allDescriptors[i];allDescriptorsByName[d["name"]]=d;}
  35. var applicationPromise;if(applicationDescriptor)
  36. applicationPromise=Promise.resolve(applicationDescriptor);else
  37. applicationPromise=loadResourcePromise(appName+".json").then(JSON.parse.bind(JSON));applicationPromise.then(parseModuleDescriptors);function parseModuleDescriptors(configuration)
  38. {var moduleJSONPromises=[];var coreModuleNames=[];for(var i=0;i<configuration.length;++i){var descriptor=configuration[i];if(descriptor["type"]==="worker")
  39. continue;var name=descriptor["name"];var moduleJSON=allDescriptorsByName[name];if(moduleJSON)
  40. moduleJSONPromises.push(Promise.resolve(moduleJSON));else
  41. moduleJSONPromises.push(loadResourcePromise(name+"/module.json").then(JSON.parse.bind(JSON)));if(descriptor["type"]==="autostart")
  42. coreModuleNames.push(name);}
  43. Promise.all(moduleJSONPromises).then(instantiateRuntime);function instantiateRuntime(moduleDescriptors)
  44. {for(var i=0;!Runtime.isReleaseMode()&&i<moduleDescriptors.length;++i)
  45. moduleDescriptors[i]["name"]=configuration[i]["name"];self.runtime=new Runtime(moduleDescriptors,coreModuleNames);}}}
  46. Runtime.queryParam=function(name)
  47. {return Runtime._queryParamsObject[name]||null;}
  48. Runtime.constructQueryParams=function(banned)
  49. {var params=[];for(var key in Runtime._queryParamsObject){if(!key||banned.indexOf(key)!==-1)
  50. continue;params.push(key+"="+Runtime._queryParamsObject[key]);}
  51. return params.length?"?"+params.join("&"):"";}
  52. Runtime._experimentsSetting=function()
  53. {try{return(JSON.parse(self.localStorage&&self.localStorage["experiments"]?self.localStorage["experiments"]:"{}"));}catch(e){console.error("Failed to parse localStorage['experiments']");return{};}}
  54. Runtime._some=function(promises)
  55. {var all=[];var wasRejected=[];for(var i=0;i<promises.length;++i){var handlerFunction=(handler.bind(promises[i],i));all.push(promises[i].catch(handlerFunction));}
  56. return Promise.all(all).then(filterOutFailuresResults);function filterOutFailuresResults(results)
  57. {var filtered=[];for(var i=0;i<results.length;++i){if(!wasRejected[i])
  58. filtered.push(results[i]);}
  59. return filtered;}
  60. function handler(index,e)
  61. {wasRejected[index]=true;console.error(e.stack);}}
  62. Runtime._console=console;Runtime._originalAssert=console.assert;Runtime._assert=function(value,message)
  63. {if(value)
  64. return;Runtime._originalAssert.call(Runtime._console,value,message);}
  65. Runtime.prototype={_registerModule:function(descriptor)
  66. {var module=new Runtime.Module(this,descriptor);this._modules.push(module);this._modulesMap[descriptor["name"]]=module;},loadModulePromise:function(moduleName)
  67. {return this._modulesMap[moduleName]._loadPromise();},_loadAutoStartModules:function(moduleNames)
  68. {var promises=[];for(var i=0;i<moduleNames.length;++i){if(Runtime.isReleaseMode())
  69. this._modulesMap[moduleNames[i]]._loaded=true;else
  70. promises.push(this.loadModulePromise(moduleNames[i]));}
  71. return Promise.all(promises);},_checkExtensionApplicability:function(extension,predicate)
  72. {if(!predicate)
  73. return false;var contextTypes=(extension.descriptor().contextTypes);if(!contextTypes)
  74. return true;for(var i=0;i<contextTypes.length;++i){var contextType=this._resolve(contextTypes[i]);var isMatching=!!contextType&&predicate(contextType);if(isMatching)
  75. return true;}
  76. return false;},isExtensionApplicableToContext:function(extension,context)
  77. {if(!context)
  78. return true;return this._checkExtensionApplicability(extension,isInstanceOf);function isInstanceOf(targetType)
  79. {return context instanceof targetType;}},isExtensionApplicableToContextTypes:function(extension,currentContextTypes)
  80. {if(!extension.descriptor().contextTypes)
  81. return true;return this._checkExtensionApplicability(extension,currentContextTypes?isContextTypeKnown:null);function isContextTypeKnown(targetType)
  82. {return currentContextTypes.has(targetType);}},extensions:function(type,context)
  83. {return this._extensions.filter(filter).sort(orderComparator);function filter(extension)
  84. {if(extension._type!==type&&extension._typeClass()!==type)
  85. return false;var activatorExperiment=extension.descriptor()["experiment"];if(activatorExperiment&&!Runtime.experiments.isEnabled(activatorExperiment))
  86. return false;activatorExperiment=extension._module._descriptor["experiment"];if(activatorExperiment&&!Runtime.experiments.isEnabled(activatorExperiment))
  87. return false;return!context||extension.isApplicable(context);}
  88. function orderComparator(extension1,extension2)
  89. {var order1=extension1.descriptor()["order"]||0;var order2=extension2.descriptor()["order"]||0;return order1-order2;}},extension:function(type,context)
  90. {return this.extensions(type,context)[0]||null;},instancesPromise:function(type,context)
  91. {var extensions=this.extensions(type,context);var promises=[];for(var i=0;i<extensions.length;++i)
  92. promises.push(extensions[i].instancePromise());return Runtime._some(promises);},instancePromise:function(type,context)
  93. {var extension=this.extension(type,context);if(!extension)
  94. return Promise.reject(new Error("No such extension: "+type+" in given context."));return extension.instancePromise();},_resolve:function(typeName)
  95. {if(!this._cachedTypeClasses[typeName]){var path=typeName.split(".");var object=window;for(var i=0;object&&(i<path.length);++i)
  96. object=object[path[i]];if(object)
  97. this._cachedTypeClasses[typeName]=(object);}
  98. return this._cachedTypeClasses[typeName]||null;}}
  99. Runtime.ModuleDescriptor=function()
  100. {this.name;this.extensions;this.dependencies;this.scripts;}
  101. Runtime.ExtensionDescriptor=function()
  102. {this.type;this.className;this.contextTypes;}
  103. Runtime.Module=function(manager,descriptor)
  104. {this._manager=manager;this._descriptor=descriptor;this._name=descriptor.name;this._instanceMap={};var extensions=(descriptor.extensions);for(var i=0;extensions&&i<extensions.length;++i)
  105. this._manager._extensions.push(new Runtime.Extension(this,extensions[i]));this._loaded=false;}
  106. Runtime.Module.prototype={name:function()
  107. {return this._name;},_loadPromise:function()
  108. {if(this._loaded)
  109. return Promise.resolve();if(this._pendingLoadPromise)
  110. return this._pendingLoadPromise;var dependencies=this._descriptor.dependencies;var dependencyPromises=[];for(var i=0;dependencies&&i<dependencies.length;++i)
  111. dependencyPromises.push(this._manager._modulesMap[dependencies[i]]._loadPromise());this._pendingLoadPromise=Promise.all(dependencyPromises).then(this._loadStylesheets.bind(this)).then(this._loadScripts.bind(this)).then(markAsLoaded.bind(this));return this._pendingLoadPromise;function markAsLoaded()
  112. {delete this._pendingLoadPromise;this._loaded=true;}},_loadStylesheets:function()
  113. {var stylesheets=this._descriptor["stylesheets"];if(!stylesheets)
  114. return Promise.resolve();var promises=[];for(var i=0;i<stylesheets.length;++i){var url=this._modularizeURL(stylesheets[i]);promises.push(loadResourcePromise(url).then(cacheStylesheet.bind(this,url),cacheStylesheet.bind(this,url,undefined)));}
  115. return Promise.all(promises).then(undefined);function cacheStylesheet(path,content)
  116. {if(!content){console.error("Failed to load stylesheet: "+path);return;}
  117. var sourceURL=window.location.href;if(window.location.search)
  118. sourceURL.replace(window.location.search,"");sourceURL=sourceURL.substring(0,sourceURL.lastIndexOf("/")+1)+path;Runtime.cachedResources[path]=content+"\n/*# sourceURL="+sourceURL+" */";}},_loadScripts:function()
  119. {if(!this._descriptor.scripts)
  120. return Promise.resolve();if(Runtime.isReleaseMode())
  121. return loadScriptsPromise([this._name+"_module.js"]);return loadScriptsPromise(this._descriptor.scripts.map(this._modularizeURL,this));},_modularizeURL:function(resourceName)
  122. {return normalizePath(this._name+"/"+resourceName);},_instance:function(className)
  123. {if(className in this._instanceMap)
  124. return this._instanceMap[className];var constructorFunction=window.eval(className);if(!(constructorFunction instanceof Function)){this._instanceMap[className]=null;return null;}
  125. var instance=new constructorFunction();this._instanceMap[className]=instance;return instance;}}
  126. Runtime.Extension=function(module,descriptor)
  127. {this._module=module;this._descriptor=descriptor;this._type=descriptor.type;this._hasTypeClass=this._type.charAt(0)==="@";this._className=descriptor.className||null;}
  128. Runtime.Extension.prototype={descriptor:function()
  129. {return this._descriptor;},module:function()
  130. {return this._module;},_typeClass:function()
  131. {if(!this._hasTypeClass)
  132. return null;return this._module._manager._resolve(this._type.substring(1));},isApplicable:function(context)
  133. {return this._module._manager.isExtensionApplicableToContext(this,context);},instancePromise:function()
  134. {if(!this._className)
  135. return Promise.reject(new Error("No class name in extension"));var className=this._className;if(this._instance)
  136. return Promise.resolve(this._instance);return this._module._loadPromise().then(constructInstance.bind(this));function constructInstance()
  137. {var result=this._module._instance(className);if(!result)
  138. return Promise.reject("Could not instantiate: "+className);return result;}}}
  139. Runtime.ExperimentsSupport=function()
  140. {this._supportEnabled=Runtime.queryParam("experiments")!==null;this._experiments=[];this._experimentNames={};this._enabledTransiently={};}
  141. Runtime.ExperimentsSupport.prototype={allConfigurableExperiments:function()
  142. {var result=[];for(var i=0;i<this._experiments.length;i++){var experiment=this._experiments[i];if(!this._enabledTransiently[experiment.name])
  143. result.push(experiment);}
  144. return result;},supportEnabled:function()
  145. {return this._supportEnabled;},_setExperimentsSetting:function(value)
  146. {if(!self.localStorage)
  147. return;self.localStorage["experiments"]=JSON.stringify(value);},register:function(experimentName,experimentTitle,hidden)
  148. {Runtime._assert(!this._experimentNames[experimentName],"Duplicate registration of experiment "+experimentName);this._experimentNames[experimentName]=true;this._experiments.push(new Runtime.Experiment(this,experimentName,experimentTitle,!!hidden));},isEnabled:function(experimentName)
  149. {this._checkExperiment(experimentName);if(this._enabledTransiently[experimentName])
  150. return true;if(!this.supportEnabled())
  151. return false;return!!Runtime._experimentsSetting()[experimentName];},setEnabled:function(experimentName,enabled)
  152. {this._checkExperiment(experimentName);var experimentsSetting=Runtime._experimentsSetting();experimentsSetting[experimentName]=enabled;this._setExperimentsSetting(experimentsSetting);},setDefaultExperiments:function(experimentNames)
  153. {for(var i=0;i<experimentNames.length;++i){this._checkExperiment(experimentNames[i]);this._enabledTransiently[experimentNames[i]]=true;}},enableForTest:function(experimentName)
  154. {this._checkExperiment(experimentName);this._enabledTransiently[experimentName]=true;},cleanUpStaleExperiments:function()
  155. {var experimentsSetting=Runtime._experimentsSetting();var cleanedUpExperimentSetting={};for(var i=0;i<this._experiments.length;++i){var experimentName=this._experiments[i].name;if(experimentsSetting[experimentName])
  156. cleanedUpExperimentSetting[experimentName]=true;}
  157. this._setExperimentsSetting(cleanedUpExperimentSetting);},_checkExperiment:function(experimentName)
  158. {Runtime._assert(this._experimentNames[experimentName],"Unknown experiment "+experimentName);}}
  159. Runtime.Experiment=function(experiments,name,title,hidden)
  160. {this.name=name;this.title=title;this.hidden=hidden;this._experiments=experiments;}
  161. Runtime.Experiment.prototype={isEnabled:function()
  162. {return this._experiments.isEnabled(this.name);},setEnabled:function(enabled)
  163. {this._experiments.setEnabled(this.name,enabled);}}
  164. {(function parseQueryParameters()
  165. {var queryParams=location.search;if(!queryParams)
  166. return;var params=queryParams.substring(1).split("&");for(var i=0;i<params.length;++i){var pair=params[i].split("=");Runtime._queryParamsObject[pair[0]]=pair[1];}
  167. var settingsParam=Runtime.queryParam("settings");if(settingsParam){try{var settings=JSON.parse(window.decodeURI(settingsParam));for(var key in settings)
  168. window.localStorage[key]=settings[key];}catch(e){}}})();}
  169. Runtime.experiments=new Runtime.ExperimentsSupport();var runtime;console=console;console.__originalAssert=console.assert;console.assert=function(value,message)
  170. {if(value)
  171. return;console.__originalAssert(value,message);}
  172. var ArrayLike;Object.isEmpty=function(obj)
  173. {for(var i in obj)
  174. return false;return true;}
  175. Object.values=function(obj)
  176. {var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i)
  177. result[i]=obj[result[i]];return result;}
  178. function mod(m,n)
  179. {return((m%n)+n)%n;}
  180. String.prototype.findAll=function(string)
  181. {var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this.indexOf(string,i+string.length);}
  182. return matches;}
  183. String.prototype.lineEndings=function()
  184. {if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.push(this.length);}
  185. return this._lineEndings;}
  186. String.prototype.lineCount=function()
  187. {var lineEndings=this.lineEndings();return lineEndings.length;}
  188. String.prototype.lineAt=function(lineNumber)
  189. {var lineEndings=this.lineEndings();var lineStart=lineNumber>0?lineEndings[lineNumber-1]+1:0;var lineEnd=lineEndings[lineNumber];var lineContent=this.substring(lineStart,lineEnd);if(lineContent.length>0&&lineContent.charAt(lineContent.length-1)==="\r")
  190. lineContent=lineContent.substring(0,lineContent.length-1);return lineContent;}
  191. String.prototype.escapeCharacters=function(chars)
  192. {var foundChar=false;for(var i=0;i<chars.length;++i){if(this.indexOf(chars.charAt(i))!==-1){foundChar=true;break;}}
  193. if(!foundChar)
  194. return String(this);var result="";for(var i=0;i<this.length;++i){if(chars.indexOf(this.charAt(i))!==-1)
  195. result+="\\";result+=this.charAt(i);}
  196. return result;}
  197. String.regexSpecialCharacters=function()
  198. {return"^[]{}()\\.^$*+?|-,";}
  199. String.prototype.escapeForRegExp=function()
  200. {return this.escapeCharacters(String.regexSpecialCharacters());}
  201. String.prototype.escapeHTML=function()
  202. {return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");}
  203. String.prototype.unescapeHTML=function()
  204. {return this.replace(/</g,"<").replace(/>/g,">").replace(/:/g,":").replace(/"/g,"\"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");}
  205. String.prototype.collapseWhitespace=function()
  206. {return this.replace(/[\s\xA0]+/g," ");}
  207. String.prototype.trimMiddle=function(maxLength)
  208. {if(this.length<=maxLength)
  209. return String(this);var leftHalf=maxLength>>1;var rightHalf=maxLength-leftHalf-1;return this.substr(0,leftHalf)+"\u2026"+this.substr(this.length-rightHalf,rightHalf);}
  210. String.prototype.trimEnd=function(maxLength)
  211. {if(this.length<=maxLength)
  212. return String(this);return this.substr(0,maxLength-1)+"\u2026";}
  213. String.prototype.trimURL=function(baseURLDomain)
  214. {var result=this.replace(/^(https|http|file):\/\//i,"");if(baseURLDomain)
  215. result=result.replace(new RegExp("^"+baseURLDomain.escapeForRegExp(),"i"),"");return result;}
  216. String.prototype.toTitleCase=function()
  217. {return this.substring(0,1).toUpperCase()+this.substring(1);}
  218. String.prototype.compareTo=function(other)
  219. {if(this>other)
  220. return 1;if(this<other)
  221. return-1;return 0;}
  222. function sanitizeHref(href)
  223. {return href&&href.trim().toLowerCase().startsWith("javascript:")?null:href;}
  224. String.prototype.removeURLFragment=function()
  225. {var fragmentIndex=this.indexOf("#");if(fragmentIndex==-1)
  226. fragmentIndex=this.length;return this.substring(0,fragmentIndex);}
  227. String.prototype.startsWith=function(substring)
  228. {return!this.lastIndexOf(substring,0);}
  229. String.prototype.endsWith=function(substring)
  230. {return this.indexOf(substring,this.length-substring.length)!==-1;}
  231. String.prototype.hashCode=function()
  232. {var result=0;for(var i=0;i<this.length;++i)
  233. result=(result*3+this.charCodeAt(i))|0;return result;}
  234. String.prototype.isDigitAt=function(index)
  235. {var c=this.charCodeAt(index);return 48<=c&&c<=57;}
  236. String.naturalOrderComparator=function(a,b)
  237. {var chunk=/^\d+|^\D+/;var chunka,chunkb,anum,bnum;while(1){if(a){if(!b)
  238. return 1;}else{if(b)
  239. return-1;else
  240. return 0;}
  241. chunka=a.match(chunk)[0];chunkb=b.match(chunk)[0];anum=!isNaN(chunka);bnum=!isNaN(chunkb);if(anum&&!bnum)
  242. return-1;if(bnum&&!anum)
  243. return 1;if(anum&&bnum){var diff=chunka-chunkb;if(diff)
  244. return diff;if(chunka.length!==chunkb.length){if(!+chunka&&!+chunkb)
  245. return chunka.length-chunkb.length;else
  246. return chunkb.length-chunka.length;}}else if(chunka!==chunkb)
  247. return(chunka<chunkb)?-1:1;a=a.substring(chunka.length);b=b.substring(chunkb.length);}}
  248. Number.constrain=function(num,min,max)
  249. {if(num<min)
  250. num=min;else if(num>max)
  251. num=max;return num;}
  252. Number.gcd=function(a,b)
  253. {if(b===0)
  254. return a;else
  255. return Number.gcd(b,a%b);}
  256. Number.toFixedIfFloating=function(value)
  257. {if(!value||isNaN(value))
  258. return value;var number=Number(value);return number%1?number.toFixed(3):String(number);}
  259. Date.prototype.toISO8601Compact=function()
  260. {function leadZero(x)
  261. {return(x>9?"":"0")+x;}
  262. return this.getFullYear()+
  263. leadZero(this.getMonth()+1)+
  264. leadZero(this.getDate())+"T"+
  265. leadZero(this.getHours())+
  266. leadZero(this.getMinutes())+
  267. leadZero(this.getSeconds());}
  268. Date.prototype.toConsoleTime=function()
  269. {function leadZero2(x)
  270. {return(x>9?"":"0")+x;}
  271. function leadZero3(x)
  272. {return(Array(4-x.toString().length)).join('0')+x;}
  273. return this.getFullYear()+"-"+
  274. leadZero2(this.getMonth()+1)+"-"+
  275. leadZero2(this.getDate())+" "+
  276. leadZero2(this.getHours())+":"+
  277. leadZero2(this.getMinutes())+":"+
  278. leadZero2(this.getSeconds())+"."+
  279. leadZero3(this.getMilliseconds());}
  280. Object.defineProperty(Array.prototype,"remove",{value:function(value,firstOnly)
  281. {var index=this.indexOf(value);if(index===-1)
  282. return;if(firstOnly){this.splice(index,1);return;}
  283. for(var i=index+1,n=this.length;i<n;++i){if(this[i]!==value)
  284. this[index++]=this[i];}
  285. this.length=index;}});Object.defineProperty(Array.prototype,"keySet",{value:function()
  286. {var keys={};for(var i=0;i<this.length;++i)
  287. keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"pushAll",{value:function(array)
  288. {Array.prototype.push.apply(this,array);}});Object.defineProperty(Array.prototype,"rotate",{value:function(index)
  289. {var result=[];for(var i=index;i<index+this.length;++i)
  290. result.push(this[i%this.length]);return result;}});Object.defineProperty(Array.prototype,"sortNumbers",{value:function()
  291. {function numericComparator(a,b)
  292. {return a-b;}
  293. this.sort(numericComparator);}});Object.defineProperty(Uint32Array.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={value:function(comparator,left,right,pivotIndex)
  294. {function swap(array,i1,i2)
  295. {var temp=array[i1];array[i1]=array[i2];array[i2]=temp;}
  296. var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left;for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,storeIndex,i);++storeIndex;}}
  297. swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.prototype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"partition",partition);var sortRange={value:function(comparator,leftBound,rightBound,sortWindowLeft,sortWindowRight)
  298. {function quickSortRange(array,comparator,left,right,sortWindowLeft,sortWindowRight)
  299. {if(right<=left)
  300. return;var pivotIndex=Math.floor(Math.random()*(right-left))+left;var pivotNewIndex=array.partition(comparator,left,right,pivotIndex);if(sortWindowLeft<pivotNewIndex)
  301. quickSortRange(array,comparator,left,pivotNewIndex-1,sortWindowLeft,sortWindowRight);if(pivotNewIndex<sortWindowRight)
  302. quickSortRange(array,comparator,pivotNewIndex+1,right,sortWindowLeft,sortWindowRight);}
  303. if(leftBound===0&&rightBound===(this.length-1)&&sortWindowLeft===0&&sortWindowRight>=rightBound)
  304. this.sort(comparator);else
  305. quickSortRange(this,comparator,leftBound,rightBound,sortWindowLeft,sortWindowRight);return this;}}
  306. Object.defineProperty(Array.prototype,"sortRange",sortRange);Object.defineProperty(Uint32Array.prototype,"sortRange",sortRange);})();Object.defineProperty(Array.prototype,"stableSort",{value:function(comparator)
  307. {function defaultComparator(a,b)
  308. {return a<b?-1:(a>b?1:0);}
  309. comparator=comparator||defaultComparator;var indices=new Array(this.length);for(var i=0;i<this.length;++i)
  310. indices[i]=i;var self=this;function indexComparator(a,b)
  311. {var result=comparator(self[a],self[b]);return result?result:a-b;}
  312. indices.sort(indexComparator);for(var i=0;i<this.length;++i){if(indices[i]<0||i===indices[i])
  313. continue;var cyclical=i;var saved=this[i];while(true){var next=indices[cyclical];indices[cyclical]=-1;if(next===i){this[cyclical]=saved;break;}else{this[cyclical]=this[next];cyclical=next;}}}
  314. return this;}});Object.defineProperty(Array.prototype,"qselect",{value:function(k,comparator)
  315. {if(k<0||k>=this.length)
  316. return;if(!comparator)
  317. comparator=function(a,b){return a-b;}
  318. var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(comparator,low,high,Math.floor((high+low)/2));if(pivotPosition===k)
  319. return this[k];else if(pivotPosition>k)
  320. high=pivotPosition-1;else
  321. low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{value:function(object,comparator,left,right)
  322. {function defaultComparator(a,b)
  323. {return a<b?-1:(a>b?1:0);}
  324. comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?right:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>0)
  325. l=m+1;else
  326. r=m;}
  327. return r;}});Object.defineProperty(Array.prototype,"upperBound",{value:function(object,comparator,left,right)
  328. {function defaultComparator(a,b)
  329. {return a<b?-1:(a>b?1:0);}
  330. comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?right:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>=0)
  331. l=m+1;else
  332. r=m;}
  333. return r;}});Object.defineProperty(Uint32Array.prototype,"lowerBound",{value:Array.prototype.lowerBound});Object.defineProperty(Uint32Array.prototype,"upperBound",{value:Array.prototype.upperBound});Object.defineProperty(Float64Array.prototype,"lowerBound",{value:Array.prototype.lowerBound});Object.defineProperty(Array.prototype,"binaryIndexOf",{value:function(value,comparator)
  334. {var index=this.lowerBound(value,comparator);return index<this.length&&comparator(value,this[index])===0?index:-1;}});Object.defineProperty(Array.prototype,"select",{value:function(field)
  335. {var result=new Array(this.length);for(var i=0;i<this.length;++i)
  336. result[i]=this[i][field];return result;}});Object.defineProperty(Array.prototype,"peekLast",{value:function()
  337. {return this[this.length-1];}});(function(){function mergeOrIntersect(array1,array2,comparator,mergeNotIntersect)
  338. {var result=[];var i=0;var j=0;while(i<array1.length&&j<array2.length){var compareValue=comparator(array1[i],array2[j]);if(mergeNotIntersect||!compareValue)
  339. result.push(compareValue<=0?array1[i]:array2[j]);if(compareValue<=0)
  340. i++;if(compareValue>=0)
  341. j++;}
  342. if(mergeNotIntersect){while(i<array1.length)
  343. result.push(array1[i++]);while(j<array2.length)
  344. result.push(array2[j++]);}
  345. return result;}
  346. Object.defineProperty(Array.prototype,"intersectOrdered",{value:function(array,comparator)
  347. {return mergeOrIntersect(this,array,comparator,false);}});Object.defineProperty(Array.prototype,"mergeOrdered",{value:function(array,comparator)
  348. {return mergeOrIntersect(this,array,comparator,true);}});}());function insertionIndexForObjectInListSortedByFunction(object,list,comparator,insertionIndexAfter)
  349. {if(insertionIndexAfter)
  350. return list.upperBound(object,comparator);else
  351. return list.lowerBound(object,comparator);}
  352. String.sprintf=function(format,var_arg)
  353. {return String.vsprintf(format,Array.prototype.slice.call(arguments,1));}
  354. String.tokenizeFormatString=function(format,formatters)
  355. {var tokens=[];var substitutionIndex=0;function addStringToken(str)
  356. {tokens.push({type:"string",value:str});}
  357. function addSpecifierToken(specifier,precision,substitutionIndex)
  358. {tokens.push({type:"specifier",specifier:specifier,precision:precision,substitutionIndex:substitutionIndex});}
  359. var index=0;for(var precentIndex=format.indexOf("%",index);precentIndex!==-1;precentIndex=format.indexOf("%",index)){addStringToken(format.substring(index,precentIndex));index=precentIndex+1;if(format[index]==="%"){addStringToken("%");++index;continue;}
  360. if(format.isDigitAt(index)){var number=parseInt(format.substring(index),10);while(format.isDigitAt(index))
  361. ++index;if(number>0&&format[index]==="$"){substitutionIndex=(number-1);++index;}}
  362. var precision=-1;if(format[index]==="."){++index;precision=parseInt(format.substring(index),10);if(isNaN(precision))
  363. precision=0;while(format.isDigitAt(index))
  364. ++index;}
  365. if(!(format[index]in formatters)){addStringToken(format.substring(precentIndex,index+1));++index;continue;}
  366. addSpecifierToken(format[index],precision,substitutionIndex);++substitutionIndex;++index;}
  367. addStringToken(format.substring(index));return tokens;}
  368. String.standardFormatters={d:function(substitution)
  369. {return!isNaN(substitution)?substitution:0;},f:function(substitution,token)
  370. {if(substitution&&token.precision>-1)
  371. substitution=substitution.toFixed(token.precision);return!isNaN(substitution)?substitution:(token.precision>-1?Number(0).toFixed(token.precision):0);},s:function(substitution)
  372. {return substitution;}}
  373. String.vsprintf=function(format,substitutions)
  374. {return String.format(format,substitutions,String.standardFormatters,"",function(a,b){return a+b;}).formattedResult;}
  375. String.format=function(format,substitutions,formatters,initialValue,append,tokenizedFormat)
  376. {if(!format||!substitutions||!substitutions.length)
  377. return{formattedResult:append(initialValue,format),unusedSubstitutions:substitutions};function prettyFunctionName()
  378. {return"String.format(\""+format+"\", \""+Array.prototype.join.call(substitutions,"\", \"")+"\")";}
  379. function warn(msg)
  380. {console.warn(prettyFunctionName()+": "+msg);}
  381. function error(msg)
  382. {console.error(prettyFunctionName()+": "+msg);}
  383. var result=initialValue;var tokens=tokenizedFormat||String.tokenizeFormatString(format,formatters);var usedSubstitutionIndexes={};for(var i=0;i<tokens.length;++i){var token=tokens[i];if(token.type==="string"){result=append(result,token.value);continue;}
  384. if(token.type!=="specifier"){error("Unknown token type \""+token.type+"\" found.");continue;}
  385. if(token.substitutionIndex>=substitutions.length){error("not enough substitution arguments. Had "+substitutions.length+" but needed "+(token.substitutionIndex+1)+", so substitution was skipped.");result=append(result,"%"+(token.precision>-1?token.precision:"")+token.specifier);continue;}
  386. usedSubstitutionIndexes[token.substitutionIndex]=true;if(!(token.specifier in formatters)){warn("unsupported format character \u201C"+token.specifier+"\u201D. Treating as a string.");result=append(result,substitutions[token.substitutionIndex]);continue;}
  387. result=append(result,formatters[token.specifier](substitutions[token.substitutionIndex],token));}
  388. var unusedSubstitutions=[];for(var i=0;i<substitutions.length;++i){if(i in usedSubstitutionIndexes)
  389. continue;unusedSubstitutions.push(substitutions[i]);}
  390. return{formattedResult:result,unusedSubstitutions:unusedSubstitutions};}
  391. function createSearchRegex(query,caseSensitive,isRegex)
  392. {var regexFlags=caseSensitive?"g":"gi";var regexObject;if(isRegex){try{regexObject=new RegExp(query,regexFlags);}catch(e){}}
  393. if(!regexObject)
  394. regexObject=createPlainTextSearchRegex(query,regexFlags);return regexObject;}
  395. function createPlainTextSearchRegex(query,flags)
  396. {var regexSpecialCharacters=String.regexSpecialCharacters();var regex="";for(var i=0;i<query.length;++i){var c=query.charAt(i);if(regexSpecialCharacters.indexOf(c)!=-1)
  397. regex+="\\";regex+=c;}
  398. return new RegExp(regex,flags||"");}
  399. function countRegexMatches(regex,content)
  400. {var text=content;var result=0;var match;while(text&&(match=regex.exec(text))){if(match[0].length>0)
  401. ++result;text=text.substring(match.index+1);}
  402. return result;}
  403. function spacesPadding(spacesCount)
  404. {return Array(spacesCount).join("\u00a0");}
  405. function numberToStringWithSpacesPadding(value,symbolsCount)
  406. {var numberString=value.toString();var paddingLength=Math.max(0,symbolsCount-numberString.length);return spacesPadding(paddingLength)+numberString;}
  407. Array.from=function(iterator)
  408. {var values=[];for(var iteratorValue=iterator.next();!iteratorValue.done;iteratorValue=iterator.next())
  409. values.push(iteratorValue.value);return values;}
  410. Set.fromArray=function(array)
  411. {return new Set(array);}
  412. Set.prototype.valuesArray=function()
  413. {return Array.from(this.values());}
  414. Set.prototype.remove=Set.prototype.delete;Map.prototype.remove=function(key)
  415. {var value=this.get(key);this.delete(key);return value;}
  416. Map.prototype.valuesArray=function()
  417. {return Array.from(this.values());}
  418. Map.prototype.keysArray=function()
  419. {return Array.from(this.keys());}
  420. var StringMultimap=function()
  421. {this._map=new Map();}
  422. StringMultimap.prototype={set:function(key,value)
  423. {var set=this._map.get(key);if(!set){set=new Set();this._map.set(key,set);}
  424. set.add(value);},get:function(key)
  425. {var result=this._map.get(key);if(!result)
  426. result=new Set();return result;},remove:function(key,value)
  427. {var values=this.get(key);values.remove(value);if(!values.size)
  428. this._map.remove(key);},removeAll:function(key)
  429. {this._map.remove(key);},keysArray:function()
  430. {return this._map.keysArray();},valuesArray:function()
  431. {var result=[];var keys=this.keysArray();for(var i=0;i<keys.length;++i)
  432. result.pushAll(this.get(keys[i]).valuesArray());return result;},clear:function()
  433. {this._map.clear();}}
  434. function loadXHR(url)
  435. {return new Promise(load);function load(successCallback,failureCallback)
  436. {function onReadyStateChanged()
  437. {if(xhr.readyState!==XMLHttpRequest.DONE)
  438. return;if(xhr.status!==200){xhr.onreadystatechange=null;failureCallback(new Error(xhr.status));return;}
  439. xhr.onreadystatechange=null;successCallback(xhr.responseText);}
  440. var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.onreadystatechange=onReadyStateChanged;xhr.send(null);}}
  441. function CallbackBarrier()
  442. {this._pendingIncomingCallbacksCount=0;}
  443. CallbackBarrier.prototype={createCallback:function(userCallback)
  444. {console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is called after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(callback)
  445. {console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is called multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCallbacksCount)
  446. this._outgoingCallback();},_incomingCallback:function(userCallback)
  447. {console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args=Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);}
  448. if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback)
  449. this._outgoingCallback();}}
  450. function suppressUnused(value)
  451. {}
  452. self.setImmediate=function(callback)
  453. {Promise.resolve().then(callback);return 0;}
  454. Promise.prototype.spread=function(callback)
  455. {return this.then(spreadPromise);function spreadPromise(arg)
  456. {return callback.apply(null,arg);}};Node.prototype.rangeOfWord=function(offset,stopCharacters,stayWithinNode,direction)
  457. {var startNode;var startOffset=0;var endNode;var endOffset=0;if(!stayWithinNode)
  458. stayWithinNode=this;if(!direction||direction==="backward"||direction==="both"){var node=this;while(node){if(node===stayWithinNode){if(!startNode)
  459. startNode=stayWithinNode;break;}
  460. if(node.nodeType===Node.TEXT_NODE){var start=(node===this?(offset-1):(node.nodeValue.length-1));for(var i=start;i>=0;--i){if(stopCharacters.indexOf(node.nodeValue[i])!==-1){startNode=node;startOffset=i+1;break;}}}
  461. if(startNode)
  462. break;node=node.traversePreviousNode(stayWithinNode);}
  463. if(!startNode){startNode=stayWithinNode;startOffset=0;}}else{startNode=this;startOffset=offset;}
  464. if(!direction||direction==="forward"||direction==="both"){node=this;while(node){if(node===stayWithinNode){if(!endNode)
  465. endNode=stayWithinNode;break;}
  466. if(node.nodeType===Node.TEXT_NODE){var start=(node===this?offset:0);for(var i=start;i<node.nodeValue.length;++i){if(stopCharacters.indexOf(node.nodeValue[i])!==-1){endNode=node;endOffset=i;break;}}}
  467. if(endNode)
  468. break;node=node.traverseNextNode(stayWithinNode);}
  469. if(!endNode){endNode=stayWithinNode;endOffset=stayWithinNode.nodeType===Node.TEXT_NODE?stayWithinNode.nodeValue.length:stayWithinNode.childNodes.length;}}else{endNode=this;endOffset=offset;}
  470. var result=this.ownerDocument.createRange();result.setStart(startNode,startOffset);result.setEnd(endNode,endOffset);return result;}
  471. Node.prototype.traverseNextTextNode=function(stayWithin)
  472. {var node=this.traverseNextNode(stayWithin);if(!node)
  473. return null;while(node&&node.nodeType!==Node.TEXT_NODE)
  474. node=node.traverseNextNode(stayWithin);return node;}
  475. Node.prototype.rangeBoundaryForOffset=function(offset)
  476. {var node=this.traverseNextTextNode(this);while(node&&offset>node.nodeValue.length){offset-=node.nodeValue.length;node=node.traverseNextTextNode(this);}
  477. if(!node)
  478. return{container:this,offset:0};return{container:node,offset:offset};}
  479. Element.prototype.positionAt=function(x,y,relativeTo)
  480. {var shift={x:0,y:0};if(relativeTo)
  481. shift=relativeTo.boxInWindow(this.ownerDocument.defaultView);if(typeof x==="number")
  482. this.style.setProperty("left",(shift.x+x)+"px");else
  483. this.style.removeProperty("left");if(typeof y==="number")
  484. this.style.setProperty("top",(shift.y+y)+"px");else
  485. this.style.removeProperty("top");}
  486. Element.prototype.isScrolledToBottom=function()
  487. {return Math.abs(this.scrollTop+this.clientHeight-this.scrollHeight)<=1;}
  488. function removeSubsequentNodes(fromNode,toNode)
  489. {for(var node=fromNode;node&&node!==toNode;){var nodeToRemove=node;node=node.nextSibling;nodeToRemove.remove();}}
  490. Element.prototype.containsEventPoint=function(event)
  491. {var box=this.getBoundingClientRect();return box.left<event.x&&event.x<box.right&&box.top<event.y&&event.y<box.bottom;}
  492. Node.prototype.enclosingNodeOrSelfWithNodeNameInArray=function(nameArray)
  493. {for(var node=this;node&&node!==this.ownerDocument;node=node.parentNodeOrShadowHost()){for(var i=0;i<nameArray.length;++i){if(node.nodeName.toLowerCase()===nameArray[i].toLowerCase())
  494. return node;}}
  495. return null;}
  496. Node.prototype.enclosingNodeOrSelfWithNodeName=function(nodeName)
  497. {return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);}
  498. Node.prototype.enclosingNodeOrSelfWithClass=function(className,stayWithin)
  499. {for(var node=this;node&&node!==stayWithin&&node!==this.ownerDocument;node=node.parentNodeOrShadowHost()){if(node.nodeType===Node.ELEMENT_NODE&&node.classList.contains(className))
  500. return(node);}
  501. return null;}
  502. Node.prototype.parentElementOrShadowHost=function()
  503. {var node=this.parentNode;if(!node)
  504. return null;if(node.nodeType===Node.ELEMENT_NODE)
  505. return(node);if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE)
  506. return(node.host);return null;}
  507. Node.prototype.parentNodeOrShadowHost=function()
  508. {return this.parentNode||this.host||null;}
  509. Node.prototype.window=function()
  510. {return this.ownerDocument.defaultView;}
  511. Element.prototype.query=function(query)
  512. {return this.ownerDocument.evaluate(query,this,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}
  513. Element.prototype.removeChildren=function()
  514. {if(this.firstChild)
  515. this.textContent="";}
  516. Element.prototype.isInsertionCaretInside=function()
  517. {var selection=this.window().getSelection();if(!selection.rangeCount||!selection.isCollapsed)
  518. return false;var selectionRange=selection.getRangeAt(0);return selectionRange.startContainer.isSelfOrDescendant(this);}
  519. function createElement(tagName,customElementType)
  520. {return document.createElement(tagName,customElementType||"");}
  521. function createTextNode(data)
  522. {return document.createTextNode(data);}
  523. Document.prototype.createElementWithClass=function(elementName,className,customElementType)
  524. {var element=this.createElement(elementName,customElementType||"");if(className)
  525. element.className=className;return element;}
  526. function createElementWithClass(elementName,className,customElementType)
  527. {return document.createElementWithClass(elementName,className,customElementType);}
  528. function createDocumentFragment()
  529. {return document.createDocumentFragment();}
  530. Element.prototype.createChild=function(elementName,className,customElementType)
  531. {var element=this.ownerDocument.createElementWithClass(elementName,className,customElementType);this.appendChild(element);return element;}
  532. DocumentFragment.prototype.createChild=Element.prototype.createChild;Element.prototype.createTextChild=function(text)
  533. {var element=this.ownerDocument.createTextNode(text);this.appendChild(element);return element;}
  534. DocumentFragment.prototype.createTextChild=Element.prototype.createTextChild;Element.prototype.createTextChildren=function(var_args)
  535. {for(var i=0,n=arguments.length;i<n;++i)
  536. this.createTextChild(arguments[i]);}
  537. DocumentFragment.prototype.createTextChildren=Element.prototype.createTextChildren;Element.prototype.appendChildren=function(var_args)
  538. {for(var i=0,n=arguments.length;i<n;++i)
  539. this.appendChild(arguments[i]);}
  540. Element.prototype.totalOffsetLeft=function()
  541. {return this.totalOffset().left;}
  542. Element.prototype.totalOffsetTop=function()
  543. {return this.totalOffset().top;}
  544. Element.prototype.totalOffset=function()
  545. {var rect=this.getBoundingClientRect();return{left:rect.left,top:rect.top};}
  546. Element.prototype.scrollOffset=function()
  547. {var curLeft=0;var curTop=0;for(var element=this;element;element=element.scrollParent){curLeft+=element.scrollLeft;curTop+=element.scrollTop;}
  548. return{left:curLeft,top:curTop};}
  549. function AnchorBox(x,y,width,height)
  550. {this.x=x||0;this.y=y||0;this.width=width||0;this.height=height||0;}
  551. AnchorBox.prototype.relativeTo=function(box)
  552. {return new AnchorBox(this.x-box.x,this.y-box.y,this.width,this.height);}
  553. AnchorBox.prototype.relativeToElement=function(element)
  554. {return this.relativeTo(element.boxInWindow(element.ownerDocument.defaultView));}
  555. AnchorBox.prototype.equals=function(anchorBox)
  556. {return!!anchorBox&&this.x===anchorBox.x&&this.y===anchorBox.y&&this.width===anchorBox.width&&this.height===anchorBox.height;}
  557. Element.prototype.offsetRelativeToWindow=function(targetWindow)
  558. {var elementOffset=new AnchorBox();var curElement=this;var curWindow=this.ownerDocument.defaultView;while(curWindow&&curElement){elementOffset.x+=curElement.totalOffsetLeft();elementOffset.y+=curElement.totalOffsetTop();if(curWindow===targetWindow)
  559. break;curElement=curWindow.frameElement;curWindow=curWindow.parent;}
  560. return elementOffset;}
  561. Element.prototype.boxInWindow=function(targetWindow)
  562. {targetWindow=targetWindow||this.ownerDocument.defaultView;var anchorBox=this.offsetRelativeToWindow(window);anchorBox.width=Math.min(this.offsetWidth,window.innerWidth-anchorBox.x);anchorBox.height=Math.min(this.offsetHeight,window.innerHeight-anchorBox.y);return anchorBox;}
  563. Element.prototype.setTextAndTitle=function(text)
  564. {this.textContent=text;this.title=text;}
  565. KeyboardEvent.prototype.__defineGetter__("data",function()
  566. {switch(this.type){case"keypress":if(!this.ctrlKey&&!this.metaKey)
  567. return String.fromCharCode(this.charCode);else
  568. return"";case"keydown":case"keyup":if(!this.ctrlKey&&!this.metaKey&&!this.altKey)
  569. return String.fromCharCode(this.which);else
  570. return"";}});Event.prototype.consume=function(preventDefault)
  571. {this.stopImmediatePropagation();if(preventDefault)
  572. this.preventDefault();this.handled=true;}
  573. Text.prototype.select=function(start,end)
  574. {start=start||0;end=end||this.textContent.length;if(start<0)
  575. start=end+start;var selection=this.ownerDocument.defaultView.getSelection();selection.removeAllRanges();var range=this.ownerDocument.createRange();range.setStart(this,start);range.setEnd(this,end);selection.addRange(range);return this;}
  576. Element.prototype.selectionLeftOffset=function()
  577. {var selection=this.window().getSelection();if(!selection.containsNode(this,true))
  578. return null;var leftOffset=selection.anchorOffset;var node=selection.anchorNode;while(node!==this){while(node.previousSibling){node=node.previousSibling;leftOffset+=node.textContent.length;}
  579. node=node.parentNodeOrShadowHost();}
  580. return leftOffset;}
  581. Node.prototype.deepTextContent=function()
  582. {var node=this.traverseNextTextNode(this);var result=[];var nonTextTags={"STYLE":1,"SCRIPT":1};while(node){if(!nonTextTags[node.parentElement.nodeName])
  583. result.push(node.textContent);node=node.traverseNextTextNode(this);}
  584. return result.join("");}
  585. Node.prototype.isAncestor=function(node)
  586. {if(!node)
  587. return false;var currentNode=node.parentNodeOrShadowHost();while(currentNode){if(this===currentNode)
  588. return true;currentNode=currentNode.parentNodeOrShadowHost();}
  589. return false;}
  590. Node.prototype.isDescendant=function(descendant)
  591. {return!!descendant&&descendant.isAncestor(this);}
  592. Node.prototype.isSelfOrAncestor=function(node)
  593. {return!!node&&(node===this||this.isAncestor(node));}
  594. Node.prototype.isSelfOrDescendant=function(node)
  595. {return!!node&&(node===this||this.isDescendant(node));}
  596. Node.prototype.traverseNextNode=function(stayWithin)
  597. {if(this.firstChild)
  598. return this.firstChild;if(this.shadowRoot)
  599. return this.shadowRoot;if(stayWithin&&this===stayWithin)
  600. return null;var node=this.nextSibling;if(node)
  601. return node;node=this;while(node&&!node.nextSibling&&(!stayWithin||!node.parentNodeOrShadowHost()||node.parentNodeOrShadowHost()!==stayWithin))
  602. node=node.parentNodeOrShadowHost();if(!node)
  603. return null;return node.nextSibling;}
  604. Node.prototype.traversePreviousNode=function(stayWithin)
  605. {if(stayWithin&&this===stayWithin)
  606. return null;var node=this.previousSibling;while(node&&node.lastChild)
  607. node=node.lastChild;if(node)
  608. return node;return this.parentNodeOrShadowHost();}
  609. Node.prototype.setTextContentTruncatedIfNeeded=function(text,placeholder)
  610. {const maxTextContentLength=65535;if(typeof text==="string"&&text.length>maxTextContentLength){this.textContent=typeof placeholder==="string"?placeholder:text.trimEnd(maxTextContentLength);return true;}
  611. this.textContent=text;return false;}
  612. Event.prototype.deepElementFromPoint=function()
  613. {var node=this.target;while(node&&node.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&node.nodeType!==Node.DOCUMENT_NODE)
  614. node=node.parentNode;if(!node)
  615. return null;node=node.elementFromPoint(this.pageX,this.pageY);while(node&&node.shadowRoot)
  616. node=node.shadowRoot.elementFromPoint(this.pageX,this.pageY);return node;}
  617. Document.prototype.deepElementFromPoint=function(x,y)
  618. {var node=this.elementFromPoint(x,y);while(node&&node.shadowRoot)
  619. node=node.shadowRoot.elementFromPoint(x,y);return node;}
  620. function isEnterKey(event){return event.keyCode!==229&&event.keyIdentifier==="Enter";}
  621. function consumeEvent(e)
  622. {e.consume();}
  623. function runOnWindowLoad(callback)
  624. {function windowLoaded()
  625. {window.removeEventListener("DOMContentLoaded",windowLoaded,false);callback();}
  626. if(document.readyState==="complete"||document.readyState==="interactive")
  627. callback();else
  628. window.addEventListener("DOMContentLoaded",windowLoaded,false);};var WorkerRuntime={};WorkerRuntime.startSharedWorker=function(moduleName,workerName)
  629. {if(Runtime.isReleaseMode()){try{var worker=new SharedWorker(moduleName+"_module.js",workerName);return Promise.resolve(worker);}catch(e){return Promise.reject(e);}}
  630. return loadResourcePromise(moduleName+"/module.json").then(start,start.bind(null,undefined));function start(content)
  631. {if(!content)
  632. throw new Error("Worker is not defined: "+moduleName+" "+new Error().stack);var scripts=JSON.parse(content)["scripts"];if(scripts.length!==1)
  633. throw new Error("WorkerRuntime.startSharedWorker supports modules with only one script!");return new SharedWorker(moduleName+"/"+scripts[0],workerName);}}
  634. WorkerRuntime.startWorker=function(moduleName)
  635. {if(Runtime.isReleaseMode())
  636. return Promise.resolve(new Worker(moduleName+"_module.js"));var loader=function(){self.onmessage=function(event){self.onmessage=null;var scripts=event.data;for(var i=0;i<scripts.length;++i){var source=scripts[i]["source"];self.eval(source+"\n//# sourceURL="+scripts[i]["url"]);}};};return loadResourcePromise(moduleName+"/module.json").then(start,start.bind(null,undefined));function start(content)
  637. {if(!content)
  638. throw new Error("Worker is not defined: "+moduleName+" "+new Error().stack);var message=[];var scripts=JSON.parse(content)["scripts"];var promise=Promise.resolve();for(var i=0;i<scripts.length;++i){var url=self._importScriptPathPrefix+moduleName+"/"+scripts[i];var parts=url.split("://");url=parts.length===1?url:parts[0]+"://"+normalizePath(parts[1]);promise=promise.then(promiseGetter(loadResourcePromise(moduleName+"/"+scripts[i]))).then(pushSource.bind(null,url),pushSource.bind(null,null,null));}
  639. return promise.then(createWorker);function promiseGetter(promise)
  640. {return function(){return promise;};}
  641. function pushSource(url,source)
  642. {if(!url){console.error("Failed to load "+url);return;}
  643. message.push({source:source,url:url});}
  644. function createWorker()
  645. {var blob=new Blob(["("+loader.toString()+")()\n//# sourceURL="+moduleName],{type:"text/javascript"});var workerURL=window.URL.createObjectURL(blob);try{var worker=new Worker(workerURL);worker.postMessage(message);return worker;}finally{window.URL.revokeObjectURL(workerURL);}}}}
  646. WorkerRuntime.Worker=function(moduleName,workerName)
  647. {this._isSharedWorker=!!workerName;this._workerPromise=workerName?WorkerRuntime.startSharedWorker(moduleName,(workerName)):WorkerRuntime.startWorker(moduleName);}
  648. WorkerRuntime.Worker.prototype={postMessage:function(message)
  649. {this._workerPromise.then(postToWorker.bind(this));function postToWorker(worker)
  650. {if(!this._disposed)
  651. worker.postMessage(message);}},dispose:function()
  652. {this._disposed=true;this._workerPromise.then(terminate);function terminate(worker)
  653. {worker.terminate();}},terminate:function()
  654. {this.dispose();},set onmessage(listener)
  655. {this._workerPromise.then(setOnMessage);function setOnMessage(worker)
  656. {worker.onmessage=listener;}},set onerror(listener)
  657. {this._workerPromise.then(setOnError);function setOnError(worker)
  658. {worker.onerror=listener;}},get port()
  659. {return new WorkerRuntime.Worker.FuturePort(this);}}
  660. WorkerRuntime.Worker.FuturePort=function(worker)
  661. {this._worker=worker;}
  662. WorkerRuntime.Worker.FuturePort.prototype={set onmessage(listener)
  663. {this._worker._workerPromise.then(setOnMessage);function setOnMessage(worker)
  664. {worker.port.onmessage=listener;}},set onerror(listener)
  665. {this._worker._workerPromise.then(setOnError);function setOnError(worker)
  666. {worker.port.onerror=listener;}}};self.WebInspector={};WebInspector.Object=function(){}
  667. WebInspector.Object.prototype={addEventListener:function(eventType,listener,thisObject)
  668. {if(!listener)
  669. console.assert(false);if(!this._listeners)
  670. this._listeners=new Map();if(!this._listeners.has(eventType))
  671. this._listeners.set(eventType,[]);this._listeners.get(eventType).push({thisObject:thisObject,listener:listener});},removeEventListener:function(eventType,listener,thisObject)
  672. {console.assert(listener);if(!this._listeners||!this._listeners.has(eventType))
  673. return;var listeners=this._listeners.get(eventType);for(var i=0;i<listeners.length;++i){if(listeners[i].listener===listener&&listeners[i].thisObject===thisObject)
  674. listeners.splice(i--,1);}
  675. if(!listeners.length)
  676. this._listeners.delete(eventType);},removeAllListeners:function()
  677. {delete this._listeners;},hasEventListeners:function(eventType)
  678. {if(!this._listeners||!this._listeners.has(eventType))
  679. return false;return true;},dispatchEventToListeners:function(eventType,eventData)
  680. {if(!this._listeners||!this._listeners.has(eventType))
  681. return false;var event=new WebInspector.Event(this,eventType,eventData);var listeners=this._listeners.get(eventType).slice(0);for(var i=0;i<listeners.length;++i){listeners[i].listener.call(listeners[i].thisObject,event);if(event._stoppedPropagation)
  682. break;}
  683. return event.defaultPrevented;}}
  684. WebInspector.Event=function(target,type,data)
  685. {this.target=target;this.type=type;this.data=data;this.defaultPrevented=false;this._stoppedPropagation=false;}
  686. WebInspector.Event.prototype={stopPropagation:function()
  687. {this._stoppedPropagation=true;},preventDefault:function()
  688. {this.defaultPrevented=true;},consume:function(preventDefault)
  689. {this.stopPropagation();if(preventDefault)
  690. this.preventDefault();}}
  691. WebInspector.EventTarget=function()
  692. {}
  693. WebInspector.EventTarget.prototype={addEventListener:function(eventType,listener,thisObject){},removeEventListener:function(eventType,listener,thisObject){},removeAllListeners:function(){},hasEventListeners:function(eventType){},dispatchEventToListeners:function(eventType,eventData){},};WebInspector.NotificationService=function(){}
  694. WebInspector.NotificationService.prototype={__proto__:WebInspector.Object.prototype}
  695. WebInspector.NotificationService.Events={InspectorAgentEnabledForTests:"InspectorAgentEnabledForTests",SelectedNodeChanged:"SelectedNodeChanged"}
  696. WebInspector.notifications=new WebInspector.NotificationService();;WebInspector.Color=function(rgba,format,originalText)
  697. {this._rgba=rgba;this._originalText=originalText||null;this._format=format||null;if(typeof this._rgba[3]==="undefined")
  698. this._rgba[3]=1;for(var i=0;i<4;++i){if(this._rgba[i]<0)
  699. this._rgba[i]=0;if(this._rgba[i]>1)
  700. this._rgba[i]=1;}}
  701. WebInspector.Color.parse=function(text)
  702. {var value=text.toLowerCase().replace(/\s+/g,"");var simple=/^(?:#([0-9a-f]{3,6})|rgb\(([^)]+)\)|(\w+)|hsl\(([^)]+)\))$/i;var match=value.match(simple);if(match){if(match[1]){var hex=match[1].toUpperCase();var format;if(hex.length===3){format=WebInspector.Color.Format.ShortHEX;hex=hex.charAt(0)+hex.charAt(0)+hex.charAt(1)+hex.charAt(1)+hex.charAt(2)+hex.charAt(2);}else
  703. format=WebInspector.Color.Format.HEX;var r=parseInt(hex.substring(0,2),16);var g=parseInt(hex.substring(2,4),16);var b=parseInt(hex.substring(4,6),16);return new WebInspector.Color([r/255,g/255,b/255,1],format,text);}
  704. if(match[2]){var rgbString=match[2].split(/\s*,\s*/);var rgba=[WebInspector.Color._parseRgbNumeric(rgbString[0]),WebInspector.Color._parseRgbNumeric(rgbString[1]),WebInspector.Color._parseRgbNumeric(rgbString[2]),1];return new WebInspector.Color(rgba,WebInspector.Color.Format.RGB,text);}
  705. if(match[3]){var nickname=match[3].toLowerCase();if(nickname in WebInspector.Color.Nicknames){var rgba=WebInspector.Color.Nicknames[nickname];var color=WebInspector.Color.fromRGBA(rgba);color._format=WebInspector.Color.Format.Nickname;color._originalText=nickname;return color;}
  706. return null;}
  707. if(match[4]){var hslString=match[4].replace(/%/g,"").split(/\s*,\s*/);var hsla=[WebInspector.Color._parseHueNumeric(hslString[0]),WebInspector.Color._parseSatLightNumeric(hslString[1]),WebInspector.Color._parseSatLightNumeric(hslString[2]),1];var rgba=WebInspector.Color._hsl2rgb(hsla);return new WebInspector.Color(rgba,WebInspector.Color.Format.HSL,text);}
  708. return null;}
  709. var advanced=/^(?:rgba\(([^)]+)\)|hsla\(([^)]+)\))$/;match=value.match(advanced);if(match){if(match[1]){var rgbaString=match[1].split(/\s*,\s*/);var rgba=[WebInspector.Color._parseRgbNumeric(rgbaString[0]),WebInspector.Color._parseRgbNumeric(rgbaString[1]),WebInspector.Color._parseRgbNumeric(rgbaString[2]),WebInspector.Color._parseAlphaNumeric(rgbaString[3])];return new WebInspector.Color(rgba,WebInspector.Color.Format.RGBA,text);}
  710. if(match[2]){var hslaString=match[2].replace(/%/g,"").split(/\s*,\s*/);var hsla=[WebInspector.Color._parseHueNumeric(hslaString[0]),WebInspector.Color._parseSatLightNumeric(hslaString[1]),WebInspector.Color._parseSatLightNumeric(hslaString[2]),WebInspector.Color._parseAlphaNumeric(hslaString[3])];var rgba=WebInspector.Color._hsl2rgb(hsla);return new WebInspector.Color(rgba,WebInspector.Color.Format.HSLA,text);}}
  711. return null;}
  712. WebInspector.Color.fromRGBA=function(rgba)
  713. {return new WebInspector.Color([rgba[0]/255,rgba[1]/255,rgba[2]/255,rgba[3]]);}
  714. WebInspector.Color.fromHSVA=function(hsva)
  715. {var h=hsva[0];var s=hsva[1];var v=hsva[2];var t=(2-s)*v;if(v===0||s===0)
  716. s=0;else
  717. s*=v/(t<1?t:2-t);var hsla=[h,s,t/2,hsva[3]];return new WebInspector.Color(WebInspector.Color._hsl2rgb(hsla),WebInspector.Color.Format.HSLA);}
  718. WebInspector.Color.prototype={format:function()
  719. {return this._format;},hsla:function()
  720. {if(this._hsla)
  721. return this._hsla;var r=this._rgba[0];var g=this._rgba[1];var b=this._rgba[2];var max=Math.max(r,g,b);var min=Math.min(r,g,b);var diff=max-min;var add=max+min;if(min===max)
  722. var h=0;else if(r===max)
  723. var h=((1/6*(g-b)/diff)+1)%1;else if(g===max)
  724. var h=(1/6*(b-r)/diff)+1/3;else
  725. var h=(1/6*(r-g)/diff)+2/3;var l=0.5*add;if(l===0)
  726. var s=0;else if(l===1)
  727. var s=1;else if(l<=0.5)
  728. var s=diff/add;else
  729. var s=diff/(2-add);this._hsla=[h,s,l,this._rgba[3]];return this._hsla;},hsva:function()
  730. {var hsla=this.hsla();var h=hsla[0];var s=hsla[1];var l=hsla[2];s*=l<0.5?l:1-l;return[h,s!==0?2*s/(l+s):0,(l+s),hsla[3]];},hasAlpha:function()
  731. {return this._rgba[3]!==1;},canBeShortHex:function()
  732. {if(this.hasAlpha())
  733. return false;for(var i=0;i<3;++i){var c=Math.round(this._rgba[i]*255);if(c%17)
  734. return false;}
  735. return true;},asString:function(format)
  736. {if(!format)
  737. format=this._format;function toRgbValue(value)
  738. {return Math.round(value*255);}
  739. function toHexValue(value)
  740. {var hex=Math.round(value*255).toString(16);return hex.length===1?"0"+hex:hex;}
  741. function toShortHexValue(value)
  742. {return(Math.round(value*255)/17).toString(16);}
  743. switch(format){case WebInspector.Color.Format.Original:return this._originalText;case WebInspector.Color.Format.RGB:if(this.hasAlpha())
  744. return null;return String.sprintf("rgb(%d, %d, %d)",toRgbValue(this._rgba[0]),toRgbValue(this._rgba[1]),toRgbValue(this._rgba[2]));case WebInspector.Color.Format.RGBA:return String.sprintf("rgba(%d, %d, %d, %f)",toRgbValue(this._rgba[0]),toRgbValue(this._rgba[1]),toRgbValue(this._rgba[2]),this._rgba[3]);case WebInspector.Color.Format.HSL:if(this.hasAlpha())
  745. return null;var hsl=this.hsla();return String.sprintf("hsl(%d, %d%, %d%)",Math.round(hsl[0]*360),Math.round(hsl[1]*100),Math.round(hsl[2]*100));case WebInspector.Color.Format.HSLA:var hsla=this.hsla();return String.sprintf("hsla(%d, %d%, %d%, %f)",Math.round(hsla[0]*360),Math.round(hsla[1]*100),Math.round(hsla[2]*100),hsla[3]);case WebInspector.Color.Format.HEX:if(this.hasAlpha())
  746. return null;return String.sprintf("#%s%s%s",toHexValue(this._rgba[0]),toHexValue(this._rgba[1]),toHexValue(this._rgba[2])).toUpperCase();case WebInspector.Color.Format.ShortHEX:if(!this.canBeShortHex())
  747. return null;return String.sprintf("#%s%s%s",toShortHexValue(this._rgba[0]),toShortHexValue(this._rgba[1]),toShortHexValue(this._rgba[2])).toUpperCase();case WebInspector.Color.Format.Nickname:return this.nickname();}
  748. return this._originalText;},_canonicalRGBA:function()
  749. {var rgba=new Array(3);for(var i=0;i<3;++i)
  750. rgba[i]=Math.round(this._rgba[i]*255);if(this._rgba[3]!==1)
  751. rgba.push(this._rgba[3]);return rgba;},nickname:function()
  752. {if(!WebInspector.Color._rgbaToNickname){WebInspector.Color._rgbaToNickname={};for(var nickname in WebInspector.Color.Nicknames){var rgba=WebInspector.Color.Nicknames[nickname];WebInspector.Color._rgbaToNickname[rgba]=nickname;}}
  753. return WebInspector.Color._rgbaToNickname[this._canonicalRGBA()]||null;},toProtocolRGBA:function()
  754. {var rgba=this._canonicalRGBA();var result={r:rgba[0],g:rgba[1],b:rgba[2]};if(rgba[3]!==1)
  755. result.a=rgba[3];return result;},invert:function()
  756. {var rgba=[];rgba[0]=1-this._rgba[0];rgba[1]=1-this._rgba[1];rgba[2]=1-this._rgba[2];rgba[3]=this._rgba[3];return new WebInspector.Color(rgba);},setAlpha:function(alpha)
  757. {var rgba=this._rgba.slice();rgba[3]=alpha;return new WebInspector.Color(rgba);}}
  758. WebInspector.Color._parseRgbNumeric=function(value)
  759. {var parsed=parseInt(value,10);if(value.indexOf("%")!==-1)
  760. parsed/=100;else
  761. parsed/=255;return parsed;}
  762. WebInspector.Color._parseHueNumeric=function(value)
  763. {return isNaN(value)?0:(parseFloat(value)/360)%1;}
  764. WebInspector.Color._parseSatLightNumeric=function(value)
  765. {return parseFloat(value)/100;}
  766. WebInspector.Color._parseAlphaNumeric=function(value)
  767. {return isNaN(value)?0:parseFloat(value);}
  768. WebInspector.Color._hsl2rgb=function(hsl)
  769. {var h=hsl[0];var s=hsl[1];var l=hsl[2];function hue2rgb(p,q,h)
  770. {if(h<0)
  771. h+=1;else if(h>1)
  772. h-=1;if((h*6)<1)
  773. return p+(q-p)*h*6;else if((h*2)<1)
  774. return q;else if((h*3)<2)
  775. return p+(q-p)*((2/3)-h)*6;else
  776. return p;}
  777. if(s<0)
  778. s=0;if(l<=0.5)
  779. var q=l*(1+s);else
  780. var q=l+s-(l*s);var p=2*l-q;var tr=h+(1/3);var tg=h;var tb=h-(1/3);var r=hue2rgb(p,q,tr);var g=hue2rgb(p,q,tg);var b=hue2rgb(p,q,tb);return[r,g,b,hsl[3]];}
  781. WebInspector.Color.Nicknames={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[237,20,61],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgrey":[169,169,169],"darkgreen":[0,100,0],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"grey":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgreen":[144,238,144],"lightgray":[211,211,211],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50],"transparent":[0,0,0,0],};WebInspector.Color.PageHighlight={Content:WebInspector.Color.fromRGBA([111,168,220,.66]),ContentLight:WebInspector.Color.fromRGBA([111,168,220,.5]),ContentOutline:WebInspector.Color.fromRGBA([9,83,148]),Padding:WebInspector.Color.fromRGBA([147,196,125,.55]),PaddingLight:WebInspector.Color.fromRGBA([147,196,125,.4]),Border:WebInspector.Color.fromRGBA([255,229,153,.66]),BorderLight:WebInspector.Color.fromRGBA([255,229,153,.5]),Margin:WebInspector.Color.fromRGBA([246,178,107,.66]),MarginLight:WebInspector.Color.fromRGBA([246,178,107,.5]),EventTarget:WebInspector.Color.fromRGBA([255,196,196,.66]),Shape:WebInspector.Color.fromRGBA([96,82,177,0.8]),ShapeMargin:WebInspector.Color.fromRGBA([96,82,127,.6])}
  782. WebInspector.Color.Format={Original:"original",Nickname:"nickname",HEX:"hex",ShortHEX:"shorthex",RGB:"rgb",RGBA:"rgba",HSL:"hsl",HSLA:"hsla"};WebInspector.Geometry={};WebInspector.Geometry._Eps=1e-5;WebInspector.Geometry.Vector=function(x,y,z)
  783. {this.x=x;this.y=y;this.z=z;}
  784. WebInspector.Geometry.Vector.prototype={length:function()
  785. {return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);},normalize:function()
  786. {var length=this.length();if(length<=WebInspector.Geometry._Eps)
  787. return;this.x/=length;this.y/=length;this.z/=length;}}
  788. WebInspector.Geometry.EulerAngles=function(alpha,beta,gamma)
  789. {this.alpha=alpha;this.beta=beta;this.gamma=gamma;}
  790. WebInspector.Geometry.EulerAngles.fromRotationMatrix=function(rotationMatrix)
  791. {var beta=Math.atan2(rotationMatrix.m23,rotationMatrix.m33);var gamma=Math.atan2(-rotationMatrix.m13,Math.sqrt(rotationMatrix.m11*rotationMatrix.m11+rotationMatrix.m12*rotationMatrix.m12));var alpha=Math.atan2(rotationMatrix.m12,rotationMatrix.m11);return new WebInspector.Geometry.EulerAngles(WebInspector.Geometry.radToDeg(alpha),WebInspector.Geometry.radToDeg(beta),WebInspector.Geometry.radToDeg(gamma));}
  792. WebInspector.Geometry.scalarProduct=function(u,v)
  793. {return u.x*v.x+u.y*v.y+u.z*v.z;}
  794. WebInspector.Geometry.crossProduct=function(u,v)
  795. {var x=u.y*v.z-u.z*v.y;var y=u.z*v.x-u.x*v.z;var z=u.x*v.y-u.y*v.x;return new WebInspector.Geometry.Vector(x,y,z);}
  796. WebInspector.Geometry.subtract=function(u,v)
  797. {var x=u.x-v.x;var y=u.y-v.y;var z=u.z-v.z;return new WebInspector.Geometry.Vector(x,y,z);}
  798. WebInspector.Geometry.multiplyVectorByMatrixAndNormalize=function(v,m)
  799. {var t=v.x*m.m14+v.y*m.m24+v.z*m.m34+m.m44;var x=(v.x*m.m11+v.y*m.m21+v.z*m.m31+m.m41)/t;var y=(v.x*m.m12+v.y*m.m22+v.z*m.m32+m.m42)/t;var z=(v.x*m.m13+v.y*m.m23+v.z*m.m33+m.m43)/t;return new WebInspector.Geometry.Vector(x,y,z);}
  800. WebInspector.Geometry.calculateAngle=function(u,v)
  801. {var uLength=u.length();var vLength=v.length();if(uLength<=WebInspector.Geometry._Eps||vLength<=WebInspector.Geometry._Eps)
  802. return 0;var cos=WebInspector.Geometry.scalarProduct(u,v)/uLength/vLength;if(Math.abs(cos)>1)
  803. return 0;return WebInspector.Geometry.radToDeg(Math.acos(cos));}
  804. WebInspector.Geometry.radToDeg=function(rad)
  805. {return rad*180/Math.PI;}
  806. WebInspector.Geometry.boundsForTransformedPoints=function(matrix,points,aggregateBounds)
  807. {if(!aggregateBounds)
  808. aggregateBounds={minX:Infinity,maxX:-Infinity,minY:Infinity,maxY:-Infinity};if(points.length%3)
  809. console.assert("Invalid size of points array");for(var p=0;p<points.length;p+=3){var vector=new WebInspector.Geometry.Vector(points[p],points[p+1],points[p+2]);vector=WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(vector,matrix);aggregateBounds.minX=Math.min(aggregateBounds.minX,vector.x);aggregateBounds.maxX=Math.max(aggregateBounds.maxX,vector.x);aggregateBounds.minY=Math.min(aggregateBounds.minY,vector.y);aggregateBounds.maxY=Math.max(aggregateBounds.maxY,vector.y);}
  810. return aggregateBounds;}
  811. function Size(width,height)
  812. {this.width=width;this.height=height;}
  813. Size.prototype.isEqual=function(size)
  814. {return!!size&&this.width===size.width&&this.height===size.height;};Size.prototype.widthToMax=function(size)
  815. {return new Size(Math.max(this.width,(typeof size==="number"?size:size.width)),this.height);};Size.prototype.addWidth=function(size)
  816. {return new Size(this.width+(typeof size==="number"?size:size.width),this.height);};Size.prototype.heightToMax=function(size)
  817. {return new Size(this.width,Math.max(this.height,(typeof size==="number"?size:size.height)));};Size.prototype.addHeight=function(size)
  818. {return new Size(this.width,this.height+(typeof size==="number"?size:size.height));};function Constraints(minimum,preferred)
  819. {this.minimum=minimum||new Size(0,0);this.preferred=preferred||this.minimum;if(this.minimum.width>this.preferred.width||this.minimum.height>this.preferred.height)
  820. throw new Error("Minimum size is greater than preferred.");}
  821. Constraints.prototype.isEqual=function(constraints)
  822. {return!!constraints&&this.minimum.isEqual(constraints.minimum)&&this.preferred.isEqual(constraints.preferred);}
  823. Constraints.prototype.widthToMax=function(value)
  824. {if(typeof value==="number")
  825. return new Constraints(this.minimum.widthToMax(value),this.preferred.widthToMax(value));return new Constraints(this.minimum.widthToMax(value.minimum),this.preferred.widthToMax(value.preferred));}
  826. Constraints.prototype.addWidth=function(value)
  827. {if(typeof value==="number")
  828. return new Constraints(this.minimum.addWidth(value),this.preferred.addWidth(value));return new Constraints(this.minimum.addWidth(value.minimum),this.preferred.addWidth(value.preferred));}
  829. Constraints.prototype.heightToMax=function(value)
  830. {if(typeof value==="number")
  831. return new Constraints(this.minimum.heightToMax(value),this.preferred.heightToMax(value));return new Constraints(this.minimum.heightToMax(value.minimum),this.preferred.heightToMax(value.preferred));}
  832. Constraints.prototype.addHeight=function(value)
  833. {if(typeof value==="number")
  834. return new Constraints(this.minimum.addHeight(value),this.preferred.addHeight(value));return new Constraints(this.minimum.addHeight(value.minimum),this.preferred.addHeight(value.preferred));};WebInspector.Console=function()
  835. {this._messages=[];}
  836. WebInspector.Console.Events={MessageAdded:"messageAdded"}
  837. WebInspector.Console.MessageLevel={Log:"log",Warning:"warning",Error:"error"}
  838. WebInspector.Console.Message=function(text,level,timestamp,show)
  839. {this.text=text;this.level=level;this.timestamp=(typeof timestamp==="number")?timestamp:Date.now();this.show=show;}
  840. WebInspector.Console.UIDelegate=function()
  841. {}
  842. WebInspector.Console.UIDelegate.prototype={showConsole:function(){}}
  843. WebInspector.Console.prototype={setUIDelegate:function(uiDelegate)
  844. {this._uiDelegate=uiDelegate;},addMessage:function(text,level,show)
  845. {var message=new WebInspector.Console.Message(text,level||WebInspector.Console.MessageLevel.Log,Date.now(),show||false);this._messages.push(message);this.dispatchEventToListeners(WebInspector.Console.Events.MessageAdded,message);},log:function(text)
  846. {this.addMessage(text,WebInspector.Console.MessageLevel.Log);},warn:function(text)
  847. {this.addMessage(text,WebInspector.Console.MessageLevel.Warning);},error:function(text)
  848. {this.addMessage(text,WebInspector.Console.MessageLevel.Error,true);},messages:function()
  849. {return this._messages;},show:function()
  850. {this.showPromise();},showPromise:function()
  851. {if(this._uiDelegate)
  852. return this._uiDelegate.showConsole();return Promise.reject();},__proto__:WebInspector.Object.prototype}
  853. WebInspector.console=new WebInspector.Console();;WebInspector.ContentProvider=function(){}
  854. WebInspector.ContentProvider.prototype={contentURL:function(){},contentType:function(){},requestContent:function(callback){},searchInContent:function(query,caseSensitive,isRegex,callback){}}
  855. WebInspector.ContentProvider.SearchMatch=function(lineNumber,lineContent){this.lineNumber=lineNumber;this.lineContent=lineContent;}
  856. WebInspector.ContentProvider.performSearchInContent=function(content,query,caseSensitive,isRegex)
  857. {var regex=createSearchRegex(query,caseSensitive,isRegex);var contentString=new String(content);var result=[];for(var i=0;i<contentString.lineCount();++i){var lineContent=contentString.lineAt(i);regex.lastIndex=0;if(regex.exec(lineContent))
  858. result.push(new WebInspector.ContentProvider.SearchMatch(i,lineContent));}
  859. return result;};WebInspector.Lock=function()
  860. {this._count=0;}
  861. WebInspector.Lock.Events={StateChanged:"StateChanged"}
  862. WebInspector.Lock.prototype={isAcquired:function()
  863. {return!!this._count;},acquire:function()
  864. {if(++this._count===1)
  865. this.dispatchEventToListeners(WebInspector.Lock.Events.StateChanged);},release:function()
  866. {--this._count;if(this._count<0){console.error("WebInspector.Lock acquire/release calls are unbalanced "+new Error().stack);return;}
  867. if(!this._count)
  868. this.dispatchEventToListeners(WebInspector.Lock.Events.StateChanged);},__proto__:WebInspector.Object.prototype};WebInspector.ParsedURL=function(url)
  869. {this.isValid=false;this.url=url;this.scheme="";this.host="";this.port="";this.path="";this.queryParams="";this.fragment="";this.folderPathComponents="";this.lastPathComponent="";var match=url.match(/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^\s\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);if(match){this.isValid=true;this.scheme=match[1].toLowerCase();this.host=match[2];this.port=match[3];this.path=match[4]||"/";this.fragment=match[5];}else{if(this.url.startsWith("data:")){this.scheme="data";return;}
  870. if(this.url==="about:blank"){this.scheme="about";return;}
  871. this.path=this.url;}
  872. var path=this.path;var indexOfQuery=path.indexOf("?");if(indexOfQuery!==-1){this.queryParams=path.substring(indexOfQuery+1);path=path.substring(0,indexOfQuery);}
  873. var lastSlashIndex=path.lastIndexOf("/");if(lastSlashIndex!==-1){this.folderPathComponents=path.substring(0,lastSlashIndex);this.lastPathComponent=path.substring(lastSlashIndex+1);}else
  874. this.lastPathComponent=path;}
  875. WebInspector.ParsedURL._decodeIfPossible=function(url)
  876. {var decodedURL=url;try{decodedURL=decodeURI(url);}catch(e){}
  877. return decodedURL;}
  878. WebInspector.ParsedURL.splitURLIntoPathComponents=function(url)
  879. {var decodedURL=WebInspector.ParsedURL._decodeIfPossible(url);var parsedURL=new WebInspector.ParsedURL(decodedURL);var origin;var folderPath;var name;if(parsedURL.isValid){origin=parsedURL.scheme+"://"+parsedURL.host;if(parsedURL.port)
  880. origin+=":"+parsedURL.port;folderPath=parsedURL.folderPathComponents;name=parsedURL.lastPathComponent;if(parsedURL.queryParams)
  881. name+="?"+parsedURL.queryParams;}else{origin="";folderPath="";name=url;}
  882. var result=[origin];var splittedPath=folderPath.split("/");for(var i=1;i<splittedPath.length;++i){if(!splittedPath[i])
  883. continue;result.push(splittedPath[i]);}
  884. result.push(name);return result;}
  885. WebInspector.ParsedURL.completeURL=function(baseURL,href)
  886. {if(href){var trimmedHref=href.trim();if(trimmedHref.startsWith("data:")||trimmedHref.startsWith("blob:")||trimmedHref.startsWith("javascript:"))
  887. return href;var parsedHref=trimmedHref.asParsedURL();if(parsedHref&&parsedHref.scheme)
  888. return trimmedHref;}else{return baseURL;}
  889. var parsedURL=baseURL.asParsedURL();if(parsedURL){if(parsedURL.isDataURL())
  890. return href;var path=href;var query=path.indexOf("?");var postfix="";if(query!==-1){postfix=path.substring(query);path=path.substring(0,query);}else{var fragment=path.indexOf("#");if(fragment!==-1){postfix=path.substring(fragment);path=path.substring(0,fragment);}}
  891. if(!path){var basePath=parsedURL.path;if(postfix.charAt(0)==="?"){var baseQuery=parsedURL.path.indexOf("?");if(baseQuery!==-1)
  892. basePath=basePath.substring(0,baseQuery);}
  893. return parsedURL.scheme+"://"+parsedURL.host+(parsedURL.port?(":"+parsedURL.port):"")+basePath+postfix;}else if(path.charAt(0)!=="/"){var prefix=parsedURL.path;var prefixQuery=prefix.indexOf("?");if(prefixQuery!==-1)
  894. prefix=prefix.substring(0,prefixQuery);prefix=prefix.substring(0,prefix.lastIndexOf("/"))+"/";path=prefix+path;}else if(path.length>1&&path.charAt(1)==="/"){return parsedURL.scheme+":"+path+postfix;}
  895. return parsedURL.scheme+"://"+parsedURL.host+(parsedURL.port?(":"+parsedURL.port):"")+normalizePath(path)+postfix;}
  896. return null;}
  897. WebInspector.ParsedURL.prototype={get displayName()
  898. {if(this._displayName)
  899. return this._displayName;if(this.isDataURL())
  900. return this.dataURLDisplayName();if(this.isAboutBlank())
  901. return this.url;this._displayName=this.lastPathComponent;if(!this._displayName)
  902. this._displayName=(this.host||"")+"/";if(this._displayName==="/")
  903. this._displayName=this.url;return this._displayName;},dataURLDisplayName:function()
  904. {if(this._dataURLDisplayName)
  905. return this._dataURLDisplayName;if(!this.isDataURL())
  906. return"";this._dataURLDisplayName=this.url.trimEnd(20);return this._dataURLDisplayName;},isAboutBlank:function()
  907. {return this.url==="about:blank";},isDataURL:function()
  908. {return this.scheme==="data";}}
  909. WebInspector.ParsedURL.splitLineAndColumn=function(string)
  910. {var lineColumnRegEx=/:(\d+)(:(\d+))?$/;var lineColumnMatch=lineColumnRegEx.exec(string);var lineNumber;var columnNumber;if(!lineColumnMatch)
  911. return null;lineNumber=parseInt(lineColumnMatch[1],10);lineNumber=isNaN(lineNumber)?undefined:lineNumber-1;if(typeof(lineColumnMatch[3])==="string"){columnNumber=parseInt(lineColumnMatch[3],10);columnNumber=isNaN(columnNumber)?undefined:columnNumber-1;}
  912. return{url:string.substring(0,string.length-lineColumnMatch[0].length),lineNumber:lineNumber,columnNumber:columnNumber};}
  913. String.prototype.asParsedURL=function()
  914. {var parsedURL=new WebInspector.ParsedURL(this.toString());if(parsedURL.isValid)
  915. return parsedURL;return null;};WebInspector.Progress=function()
  916. {}
  917. WebInspector.Progress.Events={Canceled:"Canceled",Done:"Done"}
  918. WebInspector.Progress.prototype={setTotalWork:function(totalWork){},setTitle:function(title){},setWorked:function(worked,title){},worked:function(worked){},done:function(){},isCanceled:function(){return false;},addEventListener:function(eventType,listener,thisObject){}}
  919. WebInspector.CompositeProgress=function(parent)
  920. {this._parent=parent;this._children=[];this._childrenDone=0;this._parent.setTotalWork(1);this._parent.setWorked(0);parent.addEventListener(WebInspector.Progress.Events.Canceled,this._parentCanceled.bind(this));}
  921. WebInspector.CompositeProgress.prototype={_childDone:function()
  922. {if(++this._childrenDone!==this._children.length)
  923. return;this.dispatchEventToListeners(WebInspector.Progress.Events.Done);this._parent.done();},_parentCanceled:function()
  924. {this.dispatchEventToListeners(WebInspector.Progress.Events.Canceled);for(var i=0;i<this._children.length;++i){this._children[i].dispatchEventToListeners(WebInspector.Progress.Events.Canceled);}},createSubProgress:function(weight)
  925. {var child=new WebInspector.SubProgress(this,weight);this._children.push(child);return child;},_update:function()
  926. {var totalWeights=0;var done=0;for(var i=0;i<this._children.length;++i){var child=this._children[i];if(child._totalWork)
  927. done+=child._weight*child._worked/child._totalWork;totalWeights+=child._weight;}
  928. this._parent.setWorked(done/totalWeights);},__proto__:WebInspector.Object.prototype}
  929. WebInspector.SubProgress=function(composite,weight)
  930. {this._composite=composite;this._weight=weight||1;this._worked=0;}
  931. WebInspector.SubProgress.prototype={isCanceled:function()
  932. {return this._composite._parent.isCanceled();},setTitle:function(title)
  933. {this._composite._parent.setTitle(title);},done:function()
  934. {this.setWorked(this._totalWork);this._composite._childDone();this.dispatchEventToListeners(WebInspector.Progress.Events.Done);},setTotalWork:function(totalWork)
  935. {this._totalWork=totalWork;this._composite._update();},setWorked:function(worked,title)
  936. {this._worked=worked;if(typeof title!=="undefined")
  937. this.setTitle(title);this._composite._update();},worked:function(worked)
  938. {this.setWorked(this._worked+(worked||1));},__proto__:WebInspector.Object.prototype};WebInspector.ResourceType=function(name,title,categoryTitle,color,isTextType)
  939. {this._name=name;this._title=title;this._categoryTitle=categoryTitle;this._color=color;this._isTextType=isTextType;}
  940. WebInspector.ResourceType.prototype={name:function()
  941. {return this._name;},title:function()
  942. {return this._title;},categoryTitle:function()
  943. {return this._categoryTitle;},color:function()
  944. {return this._color;},isTextType:function()
  945. {return this._isTextType;},toString:function()
  946. {return this._name;},canonicalMimeType:function()
  947. {if(this===WebInspector.resourceTypes.Document)
  948. return"text/html";if(this===WebInspector.resourceTypes.Script)
  949. return"text/javascript";if(this===WebInspector.resourceTypes.Stylesheet)
  950. return"text/css";return"";}}
  951. WebInspector.resourceTypes={Document:new WebInspector.ResourceType("document","Document","Documents","rgb(47,102,236)",true),Stylesheet:new WebInspector.ResourceType("stylesheet","Stylesheet","Stylesheets","rgb(157,231,119)",true),Image:new WebInspector.ResourceType("image","Image","Images","rgb(164,60,255)",false),Media:new WebInspector.ResourceType("media","Media","Media","rgb(164,60,255)",false),Script:new WebInspector.ResourceType("script","Script","Scripts","rgb(255,121,0)",true),XHR:new WebInspector.ResourceType("xhr","XHR","XHR","rgb(231,231,10)",true),Font:new WebInspector.ResourceType("font","Font","Fonts","rgb(255,82,62)",false),TextTrack:new WebInspector.ResourceType("texttrack","TextTrack","TextTracks","rgb(164,60,255)",true),WebSocket:new WebInspector.ResourceType("websocket","WebSocket","WebSockets","rgb(186,186,186)",false),Other:new WebInspector.ResourceType("other","Other","Other","rgb(186,186,186)",false)}
  952. WebInspector.ResourceType.mimeTypesForExtensions={"js":"text/javascript","css":"text/css","html":"text/html","htm":"text/html","xml":"application/xml","xsl":"application/xml","asp":"application/x-aspx","aspx":"application/x-aspx","jsp":"application/x-jsp","c":"text/x-c++src","cc":"text/x-c++src","cpp":"text/x-c++src","h":"text/x-c++src","m":"text/x-c++src","mm":"text/x-c++src","coffee":"text/x-coffeescript","dart":"text/javascript","ts":"text/typescript","json":"application/json","gyp":"application/json","gypi":"application/json","cs":"text/x-csharp","java":"text/x-java","less":"text/x-less","php":"text/x-php","phtml":"application/x-httpd-php","py":"text/x-python","sh":"text/x-sh","scss":"text/x-scss","vtt":"text/vtt"};WebInspector.Settings=function()
  953. {this._eventSupport=new WebInspector.Object();this._registry=({});this.colorFormat=this.createSetting("colorFormat","original");this.consoleHistory=this.createSetting("consoleHistory",[]);this.domWordWrap=this.createSetting("domWordWrap",true);this.eventListenersFilter=this.createSetting("eventListenersFilter","all");this.lastViewedScriptFile=this.createSetting("lastViewedScriptFile","application");this.monitoringXHREnabled=this.createSetting("monitoringXHREnabled",false);this.hideNetworkMessages=this.createSetting("hideNetworkMessages",false);this.preserveConsoleLog=this.createSetting("preserveConsoleLog",false);this.consoleTimestampsEnabled=this.createSetting("consoleTimestampsEnabled",false);this.resourcesLargeRows=this.createSetting("resourcesLargeRows",true);this.resourceViewTab=this.createSetting("resourceViewTab","preview");this.showInheritedComputedStyleProperties=this.createSetting("showInheritedComputedStyleProperties",false);this.showUserAgentStyles=this.createSetting("showUserAgentStyles",true);this.watchExpressions=this.createSetting("watchExpressions",[]);this.breakpoints=this.createSetting("breakpoints",[]);this.eventListenerBreakpoints=this.createSetting("eventListenerBreakpoints",[]);this.domBreakpoints=this.createSetting("domBreakpoints",[]);this.xhrBreakpoints=this.createSetting("xhrBreakpoints",[]);this.jsSourceMapsEnabled=this.createSetting("sourceMapsEnabled",true);this.cssSourceMapsEnabled=this.createSetting("cssSourceMapsEnabled",true);this.cacheDisabled=this.createSetting("cacheDisabled",false);this.showUAShadowDOM=this.createSetting("showUAShadowDOM",false);this.savedURLs=this.createSetting("savedURLs",{});this.javaScriptDisabled=this.createSetting("javaScriptDisabled",false);this.showAdvancedHeapSnapshotProperties=this.createSetting("showAdvancedHeapSnapshotProperties",false);this.recordAllocationStacks=this.createSetting("recordAllocationStacks",false);this.highResolutionCpuProfiling=this.createSetting("highResolutionCpuProfiling",false);this.searchInContentScripts=this.createSetting("searchInContentScripts",false);this.textEditorIndent=this.createSetting("textEditorIndent","    ");this.textEditorAutoDetectIndent=this.createSetting("textEditorAutoIndentIndent",true);this.textEditorAutocompletion=this.createSetting("textEditorAutocompletion",true);this.textEditorBracketMatching=this.createSetting("textEditorBracketMatching",true);this.cssReloadEnabled=this.createSetting("cssReloadEnabled",false);this.timelineLiveUpdate=this.createSetting("timelineLiveUpdate",true);this.showMetricsRulers=this.createSetting("showMetricsRulers",false);this.workerInspectorWidth=this.createSetting("workerInspectorWidth",600);this.workerInspectorHeight=this.createSetting("workerInspectorHeight",600);this.messageURLFilters=this.createSetting("messageURLFilters",{});this.networkLogHideColumns=this.createSetting("networkLogHideColumns",false);this.networkHideDataURL=this.createSetting("networkHideDataURL",false);this.networkResourceTypeFilters=this.createSetting("networkResourceTypeFilters",{});this.networkShowPrimaryLoadWaterfall=this.createSetting("networkShowPrimaryLoadWaterfall",false);this.networkColorCodeResourceTypes=this.createSetting("networkColorCodeResourceTypes",false);this.messageLevelFilters=this.createSetting("messageLevelFilters",{});this.splitVerticallyWhenDockedToRight=this.createSetting("splitVerticallyWhenDockedToRight",true);this.visiblePanels=this.createSetting("visiblePanels",{});this.shortcutPanelSwitch=this.createSetting("shortcutPanelSwitch",false);this.showWhitespacesInEditor=this.createSetting("showWhitespacesInEditor",false);this.skipStackFramesPattern=this.createRegExpSetting("skipStackFramesPattern","");this.skipContentScripts=this.createSetting("skipContentScripts",false);this.pauseOnExceptionEnabled=this.createSetting("pauseOnExceptionEnabled",false);this.pauseOnCaughtException=this.createSetting("pauseOnCaughtException",false);this.enableAsyncStackTraces=this.createSetting("enableAsyncStackTraces",false);this.showMediaQueryInspector=this.createSetting("showMediaQueryInspector",false);this.disableOverridesWarning=this.createSetting("disableOverridesWarning",false);this.disablePausedStateOverlay=this.createSetting("disablePausedStateOverlay",false);this.testPath=this.createSetting("testPath","");this.frameViewerHideChromeWindow=this.createSetting("frameViewerHideChromeWindow",false);this.highlightDOMUpdates=this.createSetting("highlightDOMUpdates",true);this.enableCustomFormatters=this.createSetting("customFormatters",false);this.showPaintRects=this.createSetting("showPaintRects",false);this.showDebugBorders=this.createSetting("showDebugBorders",false);this.showFPSCounter=this.createSetting("showFPSCounter",false);this.continuousPainting=this.createSetting("continuousPainting",false);this.showScrollBottleneckRects=this.createSetting("showScrollBottleneckRects",false);}
  954. WebInspector.Settings.prototype={createSetting:function(key,defaultValue)
  955. {if(!this._registry[key])
  956. this._registry[key]=new WebInspector.Setting(key,defaultValue,this._eventSupport,window.localStorage);return this._registry[key];},createRegExpSetting:function(key,defaultValue,regexFlags)
  957. {if(!this._registry[key])
  958. this._registry[key]=new WebInspector.RegExpSetting(key,defaultValue,this._eventSupport,window.localStorage,regexFlags);return this._registry[key];}}
  959. WebInspector.Setting=function(name,defaultValue,eventSupport,storage)
  960. {this._name=name;this._defaultValue=defaultValue;this._eventSupport=eventSupport;this._storage=storage;}
  961. WebInspector.Setting.prototype={addChangeListener:function(listener,thisObject)
  962. {this._eventSupport.addEventListener(this._name,listener,thisObject);},removeChangeListener:function(listener,thisObject)
  963. {this._eventSupport.removeEventListener(this._name,listener,thisObject);},get name()
  964. {return this._name;},get:function()
  965. {if(typeof this._value!=="undefined")
  966. return this._value;this._value=this._defaultValue;if(this._storage&&this._name in this._storage){try{this._value=JSON.parse(this._storage[this._name]);}catch(e){delete this._storage[this._name];}}
  967. return this._value;},set:function(value)
  968. {this._value=value;if(this._storage){try{var settingString=JSON.stringify(value);try{this._storage[this._name]=settingString;}catch(e){this._printSettingsSavingError(e.message,this._name,settingString);}}catch(e){WebInspector.console.error("Cannot stringify setting with name: "+this._name+", error: "+e.message);}}
  969. this._eventSupport.dispatchEventToListeners(this._name,value);},_printSettingsSavingError:function(message,name,value)
  970. {var errorMessage="Error saving setting with name: "+this._name+", value length: "+value.length+". Error: "+message;console.error(errorMessage);WebInspector.console.error(errorMessage);WebInspector.console.log("Ten largest settings: ");var sizes={__proto__:null};for(var key in this._storage)
  971. sizes[key]=this._storage.getItem(key).length;var keys=Object.keys(sizes);function comparator(key1,key2)
  972. {return sizes[key2]-sizes[key1];}
  973. keys.sort(comparator);for(var i=0;i<10&&i<keys.length;++i)
  974. WebInspector.console.log("Setting: '"+keys[i]+"', size: "+sizes[keys[i]]);},}
  975. WebInspector.RegExpSetting=function(name,defaultValue,eventSupport,storage,regexFlags)
  976. {WebInspector.Setting.call(this,name,defaultValue?[{pattern:defaultValue}]:[],eventSupport,storage);this._regexFlags=regexFlags;}
  977. WebInspector.RegExpSetting.prototype={get:function()
  978. {var result=[];var items=this.getAsArray();for(var i=0;i<items.length;++i){var item=items[i];if(item.pattern&&!item.disabled)
  979. result.push(item.pattern);}
  980. return result.join("|");},getAsArray:function()
  981. {return WebInspector.Setting.prototype.get.call(this);},set:function(value)
  982. {this.setAsArray([{pattern:value}]);},setAsArray:function(value)
  983. {delete this._regex;WebInspector.Setting.prototype.set.call(this,value);},asRegExp:function()
  984. {if(typeof this._regex!=="undefined")
  985. return this._regex;this._regex=null;try{var pattern=this.get();if(pattern)
  986. this._regex=new RegExp(pattern,this._regexFlags||"");}catch(e){}
  987. return this._regex;},__proto__:WebInspector.Setting.prototype}
  988. WebInspector.VersionController=function()
  989. {}
  990. WebInspector.VersionController.currentVersion=10;WebInspector.VersionController.prototype={updateVersion:function()
  991. {var versionSetting=WebInspector.settings.createSetting("inspectorVersion",0);var currentVersion=WebInspector.VersionController.currentVersion;var oldVersion=versionSetting.get();var methodsToRun=this._methodsToRunToUpdateVersion(oldVersion,currentVersion);for(var i=0;i<methodsToRun.length;++i)
  992. this[methodsToRun[i]].call(this);versionSetting.set(currentVersion);},_methodsToRunToUpdateVersion:function(oldVersion,currentVersion)
  993. {var result=[];for(var i=oldVersion;i<currentVersion;++i)
  994. result.push("_updateVersionFrom"+i+"To"+(i+1));return result;},_updateVersionFrom0To1:function()
  995. {this._clearBreakpointsWhenTooMany(WebInspector.settings.breakpoints,500000);},_updateVersionFrom1To2:function()
  996. {var versionSetting=WebInspector.settings.createSetting("previouslyViewedFiles",[]);versionSetting.set([]);},_updateVersionFrom2To3:function()
  997. {var fileSystemMappingSetting=WebInspector.settings.createSetting("fileSystemMapping",{});fileSystemMappingSetting.set({});if(window.localStorage)
  998. delete window.localStorage["fileMappingEntries"];},_updateVersionFrom3To4:function()
  999. {var advancedMode=WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties",false).get();WebInspector.settings.showAdvancedHeapSnapshotProperties.set(advancedMode);},_updateVersionFrom4To5:function()
  1000. {if(!window.localStorage)
  1001. return;var settingNames={"FileSystemViewSidebarWidth":"fileSystemViewSplitViewState","canvasProfileViewReplaySplitLocation":"canvasProfileViewReplaySplitViewState","canvasProfileViewSplitLocation":"canvasProfileViewSplitViewState","elementsSidebarWidth":"elementsPanelSplitViewState","StylesPaneSplitRatio":"stylesPaneSplitViewState","heapSnapshotRetainersViewSize":"heapSnapshotSplitViewState","InspectorView.splitView":"InspectorView.splitViewState","InspectorView.screencastSplitView":"InspectorView.screencastSplitViewState","Inspector.drawerSplitView":"Inspector.drawerSplitViewState","layerDetailsSplitView":"layerDetailsSplitViewState","networkSidebarWidth":"networkPanelSplitViewState","sourcesSidebarWidth":"sourcesPanelSplitViewState","scriptsPanelNavigatorSidebarWidth":"sourcesPanelNavigatorSplitViewState","sourcesPanelSplitSidebarRatio":"sourcesPanelDebuggerSidebarSplitViewState","timeline-details":"timelinePanelDetailsSplitViewState","timeline-split":"timelinePanelRecorsSplitViewState","timeline-view":"timelinePanelTimelineStackSplitViewState","auditsSidebarWidth":"auditsPanelSplitViewState","layersSidebarWidth":"layersPanelSplitViewState","profilesSidebarWidth":"profilesPanelSplitViewState","resourcesSidebarWidth":"resourcesPanelSplitViewState"};for(var oldName in settingNames){var newName=settingNames[oldName];var oldNameH=oldName+"H";var newValue=null;var oldSetting=WebInspector.settings.createSetting(oldName,undefined).get();if(oldSetting){newValue=newValue||{};newValue.vertical={};newValue.vertical.size=oldSetting;delete window.localStorage[oldName];}
  1002. var oldSettingH=WebInspector.settings.createSetting(oldNameH,undefined).get();if(oldSettingH){newValue=newValue||{};newValue.horizontal={};newValue.horizontal.size=oldSettingH;delete window.localStorage[oldNameH];}
  1003. var newSetting=WebInspector.settings.createSetting(newName,{});if(newValue)
  1004. newSetting.set(newValue);}},_updateVersionFrom5To6:function()
  1005. {if(!window.localStorage)
  1006. return;var settingNames={"debuggerSidebarHidden":"sourcesPanelSplitViewState","navigatorHidden":"sourcesPanelNavigatorSplitViewState","WebInspector.Drawer.showOnLoad":"Inspector.drawerSplitViewState"};for(var oldName in settingNames){var newName=settingNames[oldName];var oldSetting=WebInspector.settings.createSetting(oldName,undefined).get();var invert="WebInspector.Drawer.showOnLoad"===oldName;var hidden=!!oldSetting!==invert;delete window.localStorage[oldName];var showMode=hidden?"OnlyMain":"Both";var newSetting=WebInspector.settings.createSetting(newName,null);var newValue=newSetting.get()||{};newValue.vertical=newValue.vertical||{};newValue.vertical.showMode=showMode;newValue.horizontal=newValue.horizontal||{};newValue.horizontal.showMode=showMode;newSetting.set(newValue);}},_updateVersionFrom6To7:function()
  1007. {if(!window.localStorage)
  1008. return;var settingNames={"sourcesPanelNavigatorSplitViewState":"sourcesPanelNavigatorSplitViewState","elementsPanelSplitViewState":"elementsPanelSplitViewState","canvasProfileViewReplaySplitViewState":"canvasProfileViewReplaySplitViewState","stylesPaneSplitViewState":"stylesPaneSplitViewState","sourcesPanelDebuggerSidebarSplitViewState":"sourcesPanelDebuggerSidebarSplitViewState"};for(var name in settingNames){if(!(name in window.localStorage))
  1009. continue;var setting=WebInspector.settings.createSetting(name,undefined);var value=setting.get();if(!value)
  1010. continue;if(value.vertical&&value.vertical.size&&value.vertical.size<1)
  1011. value.vertical.size=0;if(value.horizontal&&value.horizontal.size&&value.horizontal.size<1)
  1012. value.horizontal.size=0;setting.set(value);}},_updateVersionFrom7To8:function()
  1013. {var settingName="deviceMetrics";if(!window.localStorage||!(settingName in window.localStorage))
  1014. return;var setting=WebInspector.settings.createSetting(settingName,undefined);var value=setting.get();if(!value)
  1015. return;var components=value.split("x");if(components.length>=3){var width=parseInt(components[0],10);var height=parseInt(components[1],10);var deviceScaleFactor=parseFloat(components[2]);if(deviceScaleFactor){components[0]=""+Math.round(width/deviceScaleFactor);components[1]=""+Math.round(height/deviceScaleFactor);}}
  1016. value=components.join("x");setting.set(value);},_updateVersionFrom8To9:function()
  1017. {if(!window.localStorage)
  1018. return;var settingNames=["skipStackFramesPattern","workspaceFolderExcludePattern"];for(var i=0;i<settingNames.length;++i){var settingName=settingNames[i];if(!(settingName in window.localStorage))
  1019. continue;try{var value=JSON.parse(window.localStorage[settingName]);if(!value)
  1020. continue;if(typeof value==="string")
  1021. value=[value];for(var j=0;j<value.length;++j){if(typeof value[j]==="string")
  1022. value[j]={pattern:value[j]};}
  1023. window.localStorage[settingName]=JSON.stringify(value);}catch(e){}}},_updateVersionFrom9To10:function()
  1024. {if(!window.localStorage)
  1025. return;for(var key in window.localStorage){if(key.startsWith("revision-history"))
  1026. window.localStorage.removeItem(key);}},_clearBreakpointsWhenTooMany:function(breakpointsSetting,maxBreakpointsCount)
  1027. {if(breakpointsSetting.get().length>maxBreakpointsCount)
  1028. breakpointsSetting.set([]);}}
  1029. WebInspector.settings;WebInspector.PauseOnExceptionStateSetting=function()
  1030. {WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._enabledChanged,this);WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOnCaughtChanged,this);this._name="pauseOnExceptionStateString";this._eventSupport=new WebInspector.Object();this._value=this._calculateValue();}
  1031. WebInspector.PauseOnExceptionStateSetting.prototype={addChangeListener:function(listener,thisObject)
  1032. {this._eventSupport.addEventListener(this._name,listener,thisObject);},removeChangeListener:function(listener,thisObject)
  1033. {this._eventSupport.removeEventListener(this._name,listener,thisObject);},get:function()
  1034. {return this._value;},_calculateValue:function()
  1035. {if(!WebInspector.settings.pauseOnExceptionEnabled.get())
  1036. return"none";return"all";},_enabledChanged:function(event)
  1037. {this._fireChangedIfNeeded();},_pauseOnCaughtChanged:function(event)
  1038. {this._fireChangedIfNeeded();},_fireChangedIfNeeded:function()
  1039. {var newValue=this._calculateValue();if(newValue===this._value)
  1040. return;this._value=newValue;this._eventSupport.dispatchEventToListeners(this._name,this._value);}};WebInspector.StaticContentProvider=function(contentType,content,contentURL)
  1041. {this._content=content;this._contentType=contentType;this._contentURL=contentURL||"";}
  1042. WebInspector.StaticContentProvider.searchInContent=function(content,query,caseSensitive,isRegex,callback)
  1043. {function performSearch()
  1044. {callback(WebInspector.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex));}
  1045. setTimeout(performSearch.bind(null),0);}
  1046. WebInspector.StaticContentProvider.prototype={contentURL:function()
  1047. {return this._contentURL;},contentType:function()
  1048. {return this._contentType;},requestContent:function(callback)
  1049. {callback(this._content);},searchInContent:function(query,caseSensitive,isRegex,callback)
  1050. {WebInspector.StaticContentProvider.searchInContent(this._content,query,caseSensitive,isRegex,callback);}};WebInspector.TextRange=function(startLine,startColumn,endLine,endColumn)
  1051. {this.startLine=startLine;this.startColumn=startColumn;this.endLine=endLine;this.endColumn=endColumn;}
  1052. WebInspector.TextRange.createFromLocation=function(line,column)
  1053. {return new WebInspector.TextRange(line,column,line,column);}
  1054. WebInspector.TextRange.fromObject=function(serializedTextRange)
  1055. {return new WebInspector.TextRange(serializedTextRange.startLine,serializedTextRange.startColumn,serializedTextRange.endLine,serializedTextRange.endColumn);}
  1056. WebInspector.TextRange.comparator=function(range1,range2)
  1057. {return range1.compareTo(range2);}
  1058. WebInspector.TextRange.prototype={isEmpty:function()
  1059. {return this.startLine===this.endLine&&this.startColumn===this.endColumn;},immediatelyPrecedes:function(range)
  1060. {if(!range)
  1061. return false;return this.endLine===range.startLine&&this.endColumn===range.startColumn;},immediatelyFollows:function(range)
  1062. {if(!range)
  1063. return false;return range.immediatelyPrecedes(this);},follows:function(range)
  1064. {return(range.endLine===this.startLine&&range.endColumn<=this.startColumn)||range.endLine<this.startLine;},get linesCount()
  1065. {return this.endLine-this.startLine;},collapseToEnd:function()
  1066. {return new WebInspector.TextRange(this.endLine,this.endColumn,this.endLine,this.endColumn);},collapseToStart:function()
  1067. {return new WebInspector.TextRange(this.startLine,this.startColumn,this.startLine,this.startColumn);},normalize:function()
  1068. {if(this.startLine>this.endLine||(this.startLine===this.endLine&&this.startColumn>this.endColumn))
  1069. return new WebInspector.TextRange(this.endLine,this.endColumn,this.startLine,this.startColumn);else
  1070. return this.clone();},clone:function()
  1071. {return new WebInspector.TextRange(this.startLine,this.startColumn,this.endLine,this.endColumn);},serializeToObject:function()
  1072. {var serializedTextRange={};serializedTextRange.startLine=this.startLine;serializedTextRange.startColumn=this.startColumn;serializedTextRange.endLine=this.endLine;serializedTextRange.endColumn=this.endColumn;return serializedTextRange;},compareTo:function(other)
  1073. {if(this.startLine>other.startLine)
  1074. return 1;if(this.startLine<other.startLine)
  1075. return-1;if(this.startColumn>other.startColumn)
  1076. return 1;if(this.startColumn<other.startColumn)
  1077. return-1;return 0;},equal:function(other)
  1078. {return this.startLine===other.startLine&&this.endLine===other.endLine&&this.startColumn===other.startColumn&&this.endColumn===other.endColumn;},shift:function(lineOffset)
  1079. {return new WebInspector.TextRange(this.startLine+lineOffset,this.startColumn,this.endLine+lineOffset,this.endColumn);},rebaseAfterTextEdit:function(originalRange,editedRange)
  1080. {console.assert(originalRange.startLine===editedRange.startLine);console.assert(originalRange.startColumn===editedRange.startColumn);var rebase=this.clone();if(!this.follows(originalRange))
  1081. return rebase;var lineDelta=editedRange.endLine-originalRange.endLine;var columnDelta=editedRange.endColumn-originalRange.endColumn;rebase.startLine+=lineDelta;rebase.endLine+=lineDelta;if(rebase.startLine===editedRange.endLine)
  1082. rebase.startColumn+=columnDelta;if(rebase.endLine===editedRange.endLine)
  1083. rebase.endColumn+=columnDelta;return rebase;},toString:function()
  1084. {return JSON.stringify(this);}}
  1085. WebInspector.SourceRange=function(offset,length)
  1086. {this.offset=offset;this.length=length;};WebInspector.TextUtils={isStopChar:function(char)
  1087. {return(char>" "&&char<"0")||(char>"9"&&char<"A")||(char>"Z"&&char<"_")||(char>"_"&&char<"a")||(char>"z"&&char<="~");},isWordChar:function(char)
  1088. {return!WebInspector.TextUtils.isStopChar(char)&&!WebInspector.TextUtils.isSpaceChar(char);},isSpaceChar:function(char)
  1089. {return WebInspector.TextUtils._SpaceCharRegex.test(char);},isWord:function(word)
  1090. {for(var i=0;i<word.length;++i){if(!WebInspector.TextUtils.isWordChar(word.charAt(i)))
  1091. return false;}
  1092. return true;},isOpeningBraceChar:function(char)
  1093. {return char==="("||char==="{";},isClosingBraceChar:function(char)
  1094. {return char===")"||char==="}";},isBraceChar:function(char)
  1095. {return WebInspector.TextUtils.isOpeningBraceChar(char)||WebInspector.TextUtils.isClosingBraceChar(char);},textToWords:function(text,isWordChar)
  1096. {var words=[];var startWord=-1;for(var i=0;i<text.length;++i){if(!isWordChar(text.charAt(i))){if(startWord!==-1)
  1097. words.push(text.substring(startWord,i));startWord=-1;}else if(startWord===-1)
  1098. startWord=i;}
  1099. if(startWord!==-1)
  1100. words.push(text.substring(startWord));return words;},findBalancedCurlyBrackets:function(source,startIndex,lastIndex)
  1101. {lastIndex=lastIndex||source.length;startIndex=startIndex||0;var counter=0;var index=startIndex;while(index<lastIndex){for(;index<lastIndex;++index){var character=source[index];if(character==="\"")
  1102. break;else if(character==="{")
  1103. ++counter;else if(character==="}"){if(--counter===0)
  1104. return index+1;}}
  1105. if(index===lastIndex)
  1106. return-1;var regexp=WebInspector.TextUtils._ClosingDoubleQuoteRegexp;regexp.lastIndex=index;if(!regexp.test(source))
  1107. return-1;index=regexp.lastIndex;}
  1108. return-1;},lineIndent:function(line)
  1109. {var indentation=0;while(indentation<line.length&&WebInspector.TextUtils.isSpaceChar(line.charAt(indentation)))
  1110. ++indentation;return line.substr(0,indentation);},isUpperCase:function(text)
  1111. {return text===text.toUpperCase();},isLowerCase:function(text)
  1112. {return text===text.toLowerCase();}}
  1113. WebInspector.TextUtils._SpaceCharRegex=/\s/;WebInspector.TextUtils._ClosingDoubleQuoteRegexp=/[^\\](?:\\\\)*"/g;WebInspector.TextUtils.Indent={TwoSpaces:"  ",FourSpaces:"    ",EightSpaces:"        ",TabCharacter:"\t"};WebInspector.Throttler=function(timeout)
  1114. {this._timeout=timeout;this._isRunningProcess=false;this._asSoonAsPossible=false;this._process=null;}
  1115. WebInspector.Throttler.prototype={_processCompleted:function()
  1116. {this._isRunningProcess=false;if(this._process)
  1117. this._innerSchedule(false);this._processCompletedForTests();},_processCompletedForTests:function()
  1118. {},_onTimeout:function()
  1119. {delete this._processTimeout;this._asSoonAsPossible=false;this._isRunningProcess=true;var process=this._process;this._process=null;process(this._processCompleted.bind(this));},schedule:function(process,asSoonAsPossible)
  1120. {this._process=process;var hasScheduledTasks=!!this._processTimeout||this._isRunningProcess;asSoonAsPossible=!!asSoonAsPossible||!hasScheduledTasks;var forceTimerUpdate=asSoonAsPossible&&!this._asSoonAsPossible;this._asSoonAsPossible=this._asSoonAsPossible||asSoonAsPossible;this._innerSchedule(forceTimerUpdate);},_innerSchedule:function(forceTimerUpdate)
  1121. {if(this._isRunningProcess)
  1122. return;if(this._processTimeout&&!forceTimerUpdate)
  1123. return;if(this._processTimeout)
  1124. this._clearTimeout(this._processTimeout);var timeout=this._asSoonAsPossible?0:this._timeout;this._processTimeout=this._setTimeout(this._onTimeout.bind(this),timeout);},_clearTimeout:function(timeoutId)
  1125. {clearTimeout(timeoutId);},_setTimeout:function(operation,timeout)
  1126. {return setTimeout(operation,timeout);}}
  1127. WebInspector.Throttler.FinishCallback;;WebInspector.UIString=function(string,vararg)
  1128. {return String.vsprintf(WebInspector.localize(string),Array.prototype.slice.call(arguments,1));}
  1129. WebInspector.UIString.capitalize=function(string,vararg)
  1130. {if(WebInspector._useLowerCaseMenuTitles===undefined)
  1131. throw"WebInspector.setLocalizationPlatform() has not been called";var localized=WebInspector.localize(string);var capitalized;if(WebInspector._useLowerCaseMenuTitles)
  1132. capitalized=localized.replace(/\^(.)/g,"$1");else
  1133. capitalized=localized.replace(/\^(.)/g,function(str,char){return char.toUpperCase();});return String.vsprintf(capitalized,Array.prototype.slice.call(arguments,1));}
  1134. WebInspector.setLocalizationPlatform=function(platform)
  1135. {WebInspector._useLowerCaseMenuTitles=platform==="windows";}
  1136. WebInspector.localize=function(string)
  1137. {return string;}
  1138. WebInspector.UIStringFormat=function(format)
  1139. {this._localizedFormat=WebInspector.localize(format);this._tokenizedFormat=String.tokenizeFormatString(this._localizedFormat,String.standardFormatters);}
  1140. WebInspector.UIStringFormat._append=function(a,b)
  1141. {return a+b;}
  1142. WebInspector.UIStringFormat.prototype={format:function(vararg)
  1143. {return String.format(this._localizedFormat,arguments,String.standardFormatters,"",WebInspector.UIStringFormat._append,this._tokenizedFormat).formattedResult;}};WebInspector.Renderer=function()
  1144. {}
  1145. WebInspector.Renderer.prototype={render:function(object){}}
  1146. WebInspector.Renderer.renderPromise=function(object)
  1147. {if(!object)
  1148. return Promise.reject(new Error("Can't render "+object));return self.runtime.instancePromise(WebInspector.Renderer,object).then(render);function render(renderer)
  1149. {return renderer.render(object);}}
  1150. WebInspector.Revealer=function()
  1151. {}
  1152. WebInspector.Revealer.reveal=function(revealable,lineNumber)
  1153. {WebInspector.Revealer.revealPromise(revealable,lineNumber);}
  1154. WebInspector.Revealer.revealPromise=function(revealable,lineNumber)
  1155. {if(!revealable)
  1156. return Promise.reject(new Error("Can't reveal "+revealable));return self.runtime.instancesPromise(WebInspector.Revealer,revealable).then(reveal);function reveal(revealers)
  1157. {var promises=[];for(var i=0;i<revealers.length;++i)
  1158. promises.push(revealers[i].reveal((revealable),lineNumber));return Promise.race(promises);}}
  1159. WebInspector.Revealer.prototype={reveal:function(object,lineNumber){}};function InspectorFrontendHostAPI()
  1160. {this.events;}
  1161. InspectorFrontendHostAPI.ContextMenuDescriptor;InspectorFrontendHostAPI.Events={AddExtensions:"addExtensions",AppendedToURL:"appendedToURL",CanceledSaveURL:"canceledSaveURL",ContextMenuCleared:"contextMenuCleared",ContextMenuItemSelected:"contextMenuItemSelected",DeviceCountUpdated:"deviceCountUpdated",DevicesUpdated:"devicesUpdated",DispatchMessage:"dispatchMessage",DispatchMessageChunk:"dispatchMessageChunk",EnterInspectElementMode:"enterInspectElementMode",FileSystemsLoaded:"fileSystemsLoaded",FileSystemRemoved:"fileSystemRemoved",FileSystemAdded:"fileSystemAdded",IndexingTotalWorkCalculated:"indexingTotalWorkCalculated",IndexingWorked:"indexingWorked",IndexingDone:"indexingDone",KeyEventUnhandled:"keyEventUnhandled",RevealSourceLine:"revealSourceLine",SavedURL:"savedURL",SearchCompleted:"searchCompleted",SetInspectedTabId:"setInspectedTabId",SetToolbarColors:"setToolbarColors",SetUseSoftMenu:"setUseSoftMenu",ShowConsole:"showConsole"}
  1162. InspectorFrontendHostAPI.EventDescriptors=[[InspectorFrontendHostAPI.Events.AddExtensions,["extensions"]],[InspectorFrontendHostAPI.Events.AppendedToURL,["url"]],[InspectorFrontendHostAPI.Events.CanceledSaveURL,["url"]],[InspectorFrontendHostAPI.Events.ContextMenuCleared,[]],[InspectorFrontendHostAPI.Events.ContextMenuItemSelected,["id"]],[InspectorFrontendHostAPI.Events.DeviceCountUpdated,["count"]],[InspectorFrontendHostAPI.Events.DevicesUpdated,["devices"]],[InspectorFrontendHostAPI.Events.DispatchMessage,["messageObject"]],[InspectorFrontendHostAPI.Events.DispatchMessageChunk,["messageChunk","messageSize"]],[InspectorFrontendHostAPI.Events.EnterInspectElementMode,[]],[InspectorFrontendHostAPI.Events.FileSystemsLoaded,["fileSystems"]],[InspectorFrontendHostAPI.Events.FileSystemRemoved,["fileSystemPath"]],[InspectorFrontendHostAPI.Events.FileSystemAdded,["errorMessage","fileSystem"]],[InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated,["requestId","fileSystemPath","totalWork"]],[InspectorFrontendHostAPI.Events.IndexingWorked,["requestId","fileSystemPath","worked"]],[InspectorFrontendHostAPI.Events.IndexingDone,["requestId","fileSystemPath"]],[InspectorFrontendHostAPI.Events.KeyEventUnhandled,["event"]],[InspectorFrontendHostAPI.Events.RevealSourceLine,["url","lineNumber","columnNumber"]],[InspectorFrontendHostAPI.Events.SavedURL,["url"]],[InspectorFrontendHostAPI.Events.SearchCompleted,["requestId","fileSystemPath","files"]],[InspectorFrontendHostAPI.Events.SetInspectedTabId,["tabId"]],[InspectorFrontendHostAPI.Events.SetToolbarColors,["backgroundColor","color"]],[InspectorFrontendHostAPI.Events.SetUseSoftMenu,["useSoftMenu"]],[InspectorFrontendHostAPI.Events.ShowConsole,[]]];InspectorFrontendHostAPI.prototype={addFileSystem:function(){},append:function(url,content){},loadCompleted:function(){},indexPath:function(requestId,fileSystemPath){},getSelectionBackgroundColor:function(){},getSelectionForegroundColor:function(){},setInspectedPageBounds:function(bounds){},setWhitelistedShortcuts:function(shortcuts){},inspectElementCompleted:function(){},openInNewTab:function(url){},removeFileSystem:function(fileSystemPath){},requestFileSystems:function(){},save:function(url,content,forceSaveAs){},searchInPath:function(requestId,fileSystemPath,query){},stopIndexing:function(requestId){},bringToFront:function(){},openUrlOnRemoteDeviceAndInspect:function(browserId,url){},closeWindow:function(){},copyText:function(text){},inspectedURLChanged:function(url){},isolatedFileSystem:function(fileSystemId,registeredName){},upgradeDraggedFileSystemPermissions:function(fileSystem){},platform:function(){},recordActionTaken:function(actionCode){},recordPanelShown:function(panelCode){},sendMessageToBackend:function(message){},setDeviceCountUpdatesEnabled:function(enabled){},setDevicesUpdatesEnabled:function(enabled){},setInjectedScriptForOrigin:function(origin,script){},setIsDocked:function(isDocked,callback){},zoomFactor:function(){},zoomIn:function(){},zoomOut:function(){},resetZoom:function(){},showContextMenuAtPoint:function(x,y,items,document){},isUnderTest:function(){},isHostedMode:function(){}}
  1163. WebInspector.InspectorFrontendHostStub=function()
  1164. {function stopEventPropagation(event)
  1165. {var zoomModifier=WebInspector.isMac()?event.metaKey:event.ctrlKey;if(zoomModifier&&(event.keyCode===187||event.keyCode===189))
  1166. event.stopPropagation();}
  1167. document.addEventListener("keydown",stopEventPropagation,true);}
  1168. WebInspector.InspectorFrontendHostStub.prototype={getSelectionBackgroundColor:function()
  1169. {return"#6e86ff";},getSelectionForegroundColor:function()
  1170. {return"#ffffff";},platform:function()
  1171. {var match=navigator.userAgent.match(/Windows NT/);if(match)
  1172. return"windows";match=navigator.userAgent.match(/Mac OS X/);if(match)
  1173. return"mac";return"linux";},loadCompleted:function()
  1174. {},bringToFront:function()
  1175. {this._windowVisible=true;},closeWindow:function()
  1176. {this._windowVisible=false;},setIsDocked:function(isDocked,callback)
  1177. {},setInspectedPageBounds:function(bounds)
  1178. {},inspectElementCompleted:function()
  1179. {},setInjectedScriptForOrigin:function(origin,script)
  1180. {},inspectedURLChanged:function(url)
  1181. {document.title=WebInspector.UIString("Developer Tools - %s",url);},copyText:function(text)
  1182. {WebInspector.console.error("Clipboard is not enabled in hosted mode. Please inspect using chrome://inspect");},openInNewTab:function(url)
  1183. {window.open(url,"_blank");},save:function(url,content,forceSaveAs)
  1184. {WebInspector.console.error("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect");this.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.CanceledSaveURL,url);},append:function(url,content)
  1185. {WebInspector.console.error("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect");},sendMessageToBackend:function(message)
  1186. {},recordActionTaken:function(actionCode)
  1187. {},recordPanelShown:function(panelCode)
  1188. {},requestFileSystems:function()
  1189. {},addFileSystem:function()
  1190. {},removeFileSystem:function(fileSystemPath)
  1191. {},isolatedFileSystem:function(fileSystemId,registeredName)
  1192. {return null;},upgradeDraggedFileSystemPermissions:function(fileSystem)
  1193. {},indexPath:function(requestId,fileSystemPath)
  1194. {},stopIndexing:function(requestId)
  1195. {},searchInPath:function(requestId,fileSystemPath,query)
  1196. {},zoomFactor:function()
  1197. {return 1;},zoomIn:function()
  1198. {},zoomOut:function()
  1199. {},resetZoom:function()
  1200. {},setWhitelistedShortcuts:function(shortcuts)
  1201. {},isUnderTest:function()
  1202. {return false;},openUrlOnRemoteDeviceAndInspect:function(browserId,url)
  1203. {},setDeviceCountUpdatesEnabled:function(enabled)
  1204. {},setDevicesUpdatesEnabled:function(enabled)
  1205. {},showContextMenuAtPoint:function(x,y,items,document)
  1206. {throw"Soft context menu should be used";},isHostedMode:function()
  1207. {return true;}};var InspectorFrontendHost=window.InspectorFrontendHost||null;(function(){function initializeInspectorFrontendHost()
  1208. {if(!InspectorFrontendHost){InspectorFrontendHost=new WebInspector.InspectorFrontendHostStub();}else{var proto=WebInspector.InspectorFrontendHostStub.prototype;for(var name in proto){var value=proto[name];if(typeof value!=="function"||InspectorFrontendHost[name])
  1209. continue;InspectorFrontendHost[name]=stub.bind(null,name);}}
  1210. function stub(name)
  1211. {console.error("Incompatible embedder: method InspectorFrontendHost."+name+" is missing. Using stub instead.");var args=Array.prototype.slice.call(arguments,1);return proto[name].apply(InspectorFrontendHost,args);}
  1212. InspectorFrontendHost.events=new WebInspector.Object();}
  1213. function InspectorFrontendAPIImpl()
  1214. {this._debugFrontend=!!Runtime.queryParam("debugFrontend");var descriptors=InspectorFrontendHostAPI.EventDescriptors;for(var i=0;i<descriptors.length;++i)
  1215. this[descriptors[i][0]]=this._dispatch.bind(this,descriptors[i][0],descriptors[i][1],descriptors[i][2]);}
  1216. InspectorFrontendAPIImpl.prototype={_dispatch:function(name,signature,runOnceLoaded)
  1217. {var params=Array.prototype.slice.call(arguments,3);if(this._debugFrontend)
  1218. setImmediate(innerDispatch);else
  1219. innerDispatch();function innerDispatch()
  1220. {if(signature.length<2){InspectorFrontendHost.events.dispatchEventToListeners(name,params[0]);return;}
  1221. var data={};for(var i=0;i<signature.length;++i)
  1222. data[signature[i]]=params[i];InspectorFrontendHost.events.dispatchEventToListeners(name,data);}}}
  1223. if(!window.DevToolsHost){initializeInspectorFrontendHost();window.InspectorFrontendAPI=new InspectorFrontendAPIImpl();WebInspector.setLocalizationPlatform(InspectorFrontendHost.platform());}else{WebInspector.setLocalizationPlatform(DevToolsHost.platform());}})();;WebInspector.platform=function()
  1224. {if(!WebInspector._platform)
  1225. WebInspector._platform=InspectorFrontendHost.platform();return WebInspector._platform;}
  1226. WebInspector.isMac=function()
  1227. {if(typeof WebInspector._isMac==="undefined")
  1228. WebInspector._isMac=WebInspector.platform()==="mac";return WebInspector._isMac;}
  1229. WebInspector.isWin=function()
  1230. {if(typeof WebInspector._isWin==="undefined")
  1231. WebInspector._isWin=WebInspector.platform()==="windows";return WebInspector._isWin;}
  1232. WebInspector.fontFamily=function()
  1233. {if(WebInspector._fontFamily)
  1234. return WebInspector._fontFamily;switch(WebInspector.platform()){case"linux":WebInspector._fontFamily="Ubuntu, Arial, sans-serif";break;case"mac":WebInspector._fontFamily="'Lucida Grande', sans-serif";break;case"windows":WebInspector._fontFamily="'Segoe UI', Tahoma, sans-serif";break;}
  1235. return WebInspector._fontFamily;}
  1236. WebInspector.monospaceFontFamily=function()
  1237. {if(WebInspector._monospaceFontFamily)
  1238. return WebInspector._monospaceFontFamily;switch(WebInspector.platform()){case"linux":WebInspector._monospaceFontFamily="dejavu sans mono, monospace";break;case"mac":WebInspector._monospaceFontFamily="Menlo, monospace";break;case"windows":WebInspector._monospaceFontFamily="Consolas, monospace";break;}
  1239. return WebInspector._monospaceFontFamily;}
  1240. WebInspector.isWorkerFrontend=function()
  1241. {return!!Runtime.queryParam("isSharedWorker");};WebInspector.UserMetrics=function()
  1242. {for(var actionName in WebInspector.UserMetrics._ActionCodes){var actionCode=WebInspector.UserMetrics._ActionCodes[actionName];this[actionName]=new WebInspector.UserMetrics._Recorder(actionCode);}}
  1243. WebInspector.UserMetrics._ActionCodes={WindowDocked:1,WindowUndocked:2,ScriptsBreakpointSet:3,TimelineStarted:4,ProfilesCPUProfileTaken:5,ProfilesHeapProfileTaken:6,AuditsStarted:7,ConsoleEvaluated:8,FileSavedInWorkspace:9,DeviceModeEnabled:10,AnimationsPlaybackRateChanged:11}
  1244. WebInspector.UserMetrics._PanelCodes={elements:1,resources:2,network:3,sources:4,timeline:5,profiles:6,audits:7,console:8}
  1245. WebInspector.UserMetrics.UserAction="UserAction";WebInspector.UserMetrics.UserActionNames={ForcedElementState:"forcedElementState",FileSaved:"fileSaved",RevertRevision:"revertRevision",ApplyOriginalContent:"applyOriginalContent",TogglePrettyPrint:"togglePrettyPrint",SetBreakpoint:"setBreakpoint",OpenSourceLink:"openSourceLink",NetworkSort:"networkSort",NetworkRequestSelected:"networkRequestSelected",NetworkRequestTabSelected:"networkRequestTabSelected",HeapSnapshotFilterChanged:"heapSnapshotFilterChanged"};WebInspector.UserMetrics.prototype={panelShown:function(panelName)
  1246. {InspectorFrontendHost.recordPanelShown(WebInspector.UserMetrics._PanelCodes[panelName]||0);}}
  1247. WebInspector.UserMetrics._Recorder=function(actionCode)
  1248. {this._actionCode=actionCode;}
  1249. WebInspector.UserMetrics._Recorder.prototype={record:function()
  1250. {InspectorFrontendHost.recordActionTaken(this._actionCode);}}
  1251. WebInspector.userMetrics=new WebInspector.UserMetrics();;if(window.domAutomationController){var uiTests={};uiTests.runTest=function(name)
  1252. {if(uiTests._testSuite)
  1253. uiTests._testSuite._runTest(name);else
  1254. uiTests._pendingTestName=name;};uiTests.testSuiteReady=function(testSuiteConstructor)
  1255. {uiTests._testSuite=testSuiteConstructor(window.domAutomationController);if(uiTests._pendingTestName){var name=uiTests._pendingTestName;delete uiTests._pendingTestName;uiTests._testSuite._runTest(name);}};};function DevToolsAPIImpl()
  1256. {this._inspectorWindow;this._pendingDispatches=[];this._lastCallId=0;this._callbacks={};}
  1257. DevToolsAPIImpl.prototype={embedderMessageAck:function(id,error)
  1258. {var callback=this._callbacks[id];delete this._callbacks[id];if(callback)
  1259. callback(error);},sendMessageToEmbedder:function(method,args,callback)
  1260. {var callId=++this._lastCallId;if(callback)
  1261. this._callbacks[callId]=callback;var message={"id":callId,"method":method};if(args.length)
  1262. message.params=args;DevToolsHost.sendMessageToEmbedder(JSON.stringify(message));},setInspectorWindow:function(inspectorWindow)
  1263. {this._inspectorWindow=inspectorWindow;if(!inspectorWindow)
  1264. return;while(this._pendingDispatches.length)
  1265. this._pendingDispatches.shift()(inspectorWindow);},_dispatchOnInspectorWindow:function(callback)
  1266. {if(this._inspectorWindow){callback(this._inspectorWindow);}else{this._pendingDispatches.push(callback);}},_dispatchOnInspectorFrontendAPI:function(method,args)
  1267. {function dispatch(inspectorWindow)
  1268. {var api=inspectorWindow.InspectorFrontendAPI;api[method].apply(api,args);}
  1269. this._dispatchOnInspectorWindow(dispatch);},addExtensions:function(extensions)
  1270. {function dispatch(inspectorWindow)
  1271. {if(inspectorWindow.WebInspector.addExtensions)
  1272. inspectorWindow.WebInspector.addExtensions(extensions);else
  1273. inspectorWindow.InspectorFrontendAPI.addExtensions(extensions);}
  1274. this._dispatchOnInspectorWindow(dispatch);},appendedToURL:function(url)
  1275. {this._dispatchOnInspectorFrontendAPI("appendedToURL",[url]);},canceledSaveURL:function(url)
  1276. {this._dispatchOnInspectorFrontendAPI("canceledSaveURL",[url]);},contextMenuCleared:function()
  1277. {this._dispatchOnInspectorFrontendAPI("contextMenuCleared",[]);},contextMenuItemSelected:function(id)
  1278. {this._dispatchOnInspectorFrontendAPI("contextMenuItemSelected",[id]);},deviceCountUpdated:function(count)
  1279. {this._dispatchOnInspectorFrontendAPI("deviceCountUpdated",[count]);},devicesUpdated:function(devices)
  1280. {this._dispatchOnInspectorFrontendAPI("devicesUpdated",[devices]);},dispatchMessage:function(message)
  1281. {this._dispatchOnInspectorFrontendAPI("dispatchMessage",[message]);},dispatchMessageChunk:function(messageChunk,messageSize)
  1282. {this._dispatchOnInspectorFrontendAPI("dispatchMessageChunk",[messageChunk,messageSize]);},enterInspectElementMode:function()
  1283. {this._dispatchOnInspectorFrontendAPI("enterInspectElementMode",[]);},fileSystemsLoaded:function(fileSystems)
  1284. {this._dispatchOnInspectorFrontendAPI("fileSystemsLoaded",[fileSystems]);},fileSystemRemoved:function(fileSystemPath)
  1285. {this._dispatchOnInspectorFrontendAPI("fileSystemRemoved",[fileSystemPath]);},fileSystemAdded:function(errorMessage,fileSystem)
  1286. {this._dispatchOnInspectorFrontendAPI("fileSystemAdded",[errorMessage,fileSystem]);},indexingTotalWorkCalculated:function(requestId,fileSystemPath,totalWork)
  1287. {this._dispatchOnInspectorFrontendAPI("indexingTotalWorkCalculated",[requestId,fileSystemPath,totalWork]);},indexingWorked:function(requestId,fileSystemPath,worked)
  1288. {this._dispatchOnInspectorFrontendAPI("indexingWorked",[requestId,fileSystemPath,worked]);},indexingDone:function(requestId,fileSystemPath)
  1289. {this._dispatchOnInspectorFrontendAPI("indexingDone",[requestId,fileSystemPath]);},keyEventUnhandled:function(event)
  1290. {this._dispatchOnInspectorFrontendAPI("keyEventUnhandled",[event]);},revealSourceLine:function(url,lineNumber,columnNumber)
  1291. {this._dispatchOnInspectorFrontendAPI("revealSourceLine",[url,lineNumber,columnNumber]);},savedURL:function(url)
  1292. {this._dispatchOnInspectorFrontendAPI("savedURL",[url]);},searchCompleted:function(requestId,fileSystemPath,files)
  1293. {this._dispatchOnInspectorFrontendAPI("searchCompleted",[requestId,fileSystemPath,files]);},setInspectedTabId:function(tabId)
  1294. {function dispatch(inspectorWindow)
  1295. {if(inspectorWindow.WebInspector.setInspectedTabId)
  1296. inspectorWindow.WebInspector.setInspectedTabId(tabId);else
  1297. inspectorWindow.InspectorFrontendAPI.setInspectedTabId(tabId);}
  1298. this._dispatchOnInspectorWindow(dispatch);},setToolbarColors:function(backgroundColor,color)
  1299. {this._dispatchOnInspectorFrontendAPI("setToolbarColors",[backgroundColor,color]);},setUseSoftMenu:function(useSoftMenu)
  1300. {this._dispatchOnInspectorFrontendAPI("setUseSoftMenu",[useSoftMenu]);},showConsole:function()
  1301. {this._dispatchOnInspectorFrontendAPI("showConsole",[]);}}
  1302. var DevToolsAPI=new DevToolsAPIImpl();;WebInspector.InspectorFrontendHostImpl=function()
  1303. {}
  1304. WebInspector.InspectorFrontendHostImpl.prototype={getSelectionBackgroundColor:function()
  1305. {return DevToolsHost.getSelectionBackgroundColor();},getSelectionForegroundColor:function()
  1306. {return DevToolsHost.getSelectionForegroundColor();},platform:function()
  1307. {return DevToolsHost.platform();},loadCompleted:function()
  1308. {DevToolsAPI.sendMessageToEmbedder("loadCompleted",[],null);},bringToFront:function()
  1309. {DevToolsAPI.sendMessageToEmbedder("bringToFront",[],null);},closeWindow:function()
  1310. {DevToolsAPI.sendMessageToEmbedder("closeWindow",[],null);},setIsDocked:function(isDocked,callback)
  1311. {DevToolsAPI.sendMessageToEmbedder("setIsDocked",[isDocked],callback);},setInspectedPageBounds:function(bounds)
  1312. {DevToolsAPI.sendMessageToEmbedder("setInspectedPageBounds",[bounds],null);},inspectElementCompleted:function()
  1313. {DevToolsAPI.sendMessageToEmbedder("inspectElementCompleted",[],null);},setInjectedScriptForOrigin:function(origin,script)
  1314. {DevToolsHost.setInjectedScriptForOrigin(origin,script);},inspectedURLChanged:function(url)
  1315. {DevToolsAPI.sendMessageToEmbedder("inspectedURLChanged",[url],null);},copyText:function(text)
  1316. {DevToolsHost.copyText(text);},openInNewTab:function(url)
  1317. {DevToolsAPI.sendMessageToEmbedder("openInNewTab",[url],null);},save:function(url,content,forceSaveAs)
  1318. {DevToolsAPI.sendMessageToEmbedder("save",[url,content,forceSaveAs],null);},append:function(url,content)
  1319. {DevToolsAPI.sendMessageToEmbedder("append",[url,content],null);},sendMessageToBackend:function(message)
  1320. {DevToolsHost.sendMessageToBackend(message);},recordActionTaken:function(actionCode)
  1321. {DevToolsAPI.sendMessageToEmbedder("recordActionUMA",["DevTools.ActionTaken",actionCode],null);},recordPanelShown:function(panelCode)
  1322. {DevToolsAPI.sendMessageToEmbedder("recordActionUMA",["DevTools.PanelShown",panelCode],null);},requestFileSystems:function()
  1323. {DevToolsAPI.sendMessageToEmbedder("requestFileSystems",[],null);},addFileSystem:function()
  1324. {DevToolsAPI.sendMessageToEmbedder("addFileSystem",[],null);},removeFileSystem:function(fileSystemPath)
  1325. {DevToolsAPI.sendMessageToEmbedder("removeFileSystem",[fileSystemPath],null);},isolatedFileSystem:function(fileSystemId,registeredName)
  1326. {return DevToolsHost.isolatedFileSystem(fileSystemId,registeredName);},upgradeDraggedFileSystemPermissions:function(fileSystem)
  1327. {DevToolsHost.upgradeDraggedFileSystemPermissions(fileSystem);},indexPath:function(requestId,fileSystemPath)
  1328. {DevToolsAPI.sendMessageToEmbedder("indexPath",[requestId,fileSystemPath],null);},stopIndexing:function(requestId)
  1329. {DevToolsAPI.sendMessageToEmbedder("stopIndexing",[requestId],null);},searchInPath:function(requestId,fileSystemPath,query)
  1330. {DevToolsAPI.sendMessageToEmbedder("searchInPath",[requestId,fileSystemPath,query],null);},zoomFactor:function()
  1331. {return DevToolsHost.zoomFactor();},zoomIn:function()
  1332. {DevToolsAPI.sendMessageToEmbedder("zoomIn",[],null);},zoomOut:function()
  1333. {DevToolsAPI.sendMessageToEmbedder("zoomOut",[],null);},resetZoom:function()
  1334. {DevToolsAPI.sendMessageToEmbedder("resetZoom",[],null);},setWhitelistedShortcuts:function(shortcuts)
  1335. {DevToolsAPI.sendMessageToEmbedder("setWhitelistedShortcuts",[shortcuts],null);},isUnderTest:function()
  1336. {return DevToolsHost.isUnderTest();},openUrlOnRemoteDeviceAndInspect:function(browserId,url)
  1337. {DevToolsAPI.sendMessageToEmbedder("openUrlOnRemoteDeviceAndInspect",[browserId,url],null);},setDeviceCountUpdatesEnabled:function(enabled)
  1338. {DevToolsAPI.sendMessageToEmbedder("setDeviceCountUpdatesEnabled",[enabled],null);},setDevicesUpdatesEnabled:function(enabled)
  1339. {DevToolsAPI.sendMessageToEmbedder("setDevicesUpdatesEnabled",[enabled],null);},showContextMenuAtPoint:function(x,y,items,document)
  1340. {DevToolsHost.showContextMenuAtPoint(x,y,items,document);},isHostedMode:function()
  1341. {return DevToolsHost.isHostedMode();},port:function()
  1342. {return"unknown";},requestSetDockSide:function(dockSide)
  1343. {DevToolsAPI.sendMessageToEmbedder("setIsDocked",[dockSide!=="undocked"],null);},supportsFileSystems:function()
  1344. {return true;},canInspectWorkers:function()
  1345. {return true;},canSaveAs:function()
  1346. {return true;},canSave:function()
  1347. {return true;},loaded:function()
  1348. {},hiddenPanels:function()
  1349. {return"";},localizedStringsURL:function()
  1350. {return"";},close:function(url)
  1351. {}};WebInspector.DevToolsApp=function()
  1352. {this._iframe=document.getElementById("inspector-app-iframe");this._inspectorFrontendHostImpl=new WebInspector.InspectorFrontendHostImpl();this._inspectorWindow=this._iframe.contentWindow;this._inspectorWindow.InspectorFrontendHost=this._inspectorFrontendHostImpl;DevToolsAPI.setInspectorWindow(this._inspectorWindow);this._iframe.focus();this._iframe.addEventListener("load",this._onIframeLoad.bind(this),false);}
  1353. WebInspector.DevToolsApp.prototype={_onIframeLoad:function()
  1354. {function getValue(property)
  1355. {if(property=="padding-left"){return{getFloatValue:function(){return this.__paddingLeft;},__paddingLeft:parseFloat(this.paddingLeft)};}
  1356. throw new Error("getPropertyCSSValue is undefined");}
  1357. this._iframe.contentWindow.CSSStyleDeclaration.prototype.getPropertyCSSValue=getValue;this._iframe.contentWindow.CSSPrimitiveValue={CSS_PX:"CSS_PX"};}}
  1358. runOnWindowLoad(function(){new WebInspector.DevToolsApp();});;applicationDescriptor=[{"type":"autostart","name":"platform"},{"type":"autostart","name":"host"},{"type":"autostart","name":"common"},{"type":"autostart","name":"devtools_app"}];Runtime.startApplication("devtools");